go rand code example Example 1: go rand seed rand.Seed(time.Now().UTC().UnixNano()) Example 2: go generate random number rand.Intn(max - min) + min