Golang Generate Random Number

package mainimport (
"fmt"
"time"
"math/rand"
)
func main() {
for z:=0; z<9; z++ {
rand.Seed(time.Now().UTC().UnixNano())
fmt.Println("My favorite number is", rand.Intn(10))
}
}

--

--

--

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

DevOps Admin: staying grounded

New Feature Update: World Craft

🏆BIGGEST REWARD EVER 🏆

Have you ever lost your love for programming?

How to easily deploy a Drupal instance on Kubernetes

Pros and Cons of AuraPortal - with an AuraPortal Alternative

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin FOO

Kevin FOO

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.

More from Medium

How to Use Sync.WaitGroup to Wait Goroutines in Go?

Golang Debugging with Delve — [Step by Step]

Simple IoT Messages Delivery With GoLang — 2

go range variables