Generating random numbers over a range in Go

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)