Random number generator following Zipf's law
The built-in package implementation doesn't support alpha < 1.0.
Referring to the answer in here, here is a go version zipf generator.
The generator will randomly produce a number in the range of [0, n-1].
// import "github.com/chinuy/zipf"
r := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
z := zipf.NewZipf(r, 1.0, 10) // n = 10, alpha = 1.0
for i := 0; i < 10; i++ {
randNumber := z.Uint64()
// do something you want
}