Package rand Table of Contents Seed a random number generator Generate an integer in a given range Seed a random number generator howto rand.Seed(time.Now().UTC().UnixNano()) https://stackoverflow.com/questions/12321133/golang-random-number-generator-how-to-seed-properly/12321192 Generate an integer in a given range howto rand.Intn(n int) returns a pseudo-random number in [0, n). rand.Seed(time.Now().Unix()) return rand.Intn(max - min) + min https://golang.org/pkg/math/rand/#Intn http://golangcookbook.blogspot.com/2012/11/generate-random-number-in-given-range.html