I found this example at Go Cookbook, which is equivalent to rand.Range(min, max int) (if that function existed):
rand.Intn(max - min) + min
Don’t forget to seed the PRNG before calling any rand function.
rand.Seed(time.Now().UnixNano())
I found this example at Go Cookbook, which is equivalent to rand.Range(min, max int) (if that function existed):
rand.Intn(max - min) + min
Don’t forget to seed the PRNG before calling any rand function.
rand.Seed(time.Now().UnixNano())