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))
}
}

--

--

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

15 Followers

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