From 0df7326c1cbf9da05cb815bf757fabed9763a739 Mon Sep 17 00:00:00 2001 From: Daniel Tam Date: Wed, 10 Jun 2020 00:31:39 -0500 Subject: [PATCH] fixed rng seed to only be called once at initilization --- images.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/images.go b/images.go index a7f4082..a9acbb9 100644 --- a/images.go +++ b/images.go @@ -150,9 +150,6 @@ func get_redditbooru_image(sub string) <-chan string{ return } - // randomize the seed for the random int - rand.Seed(time.Now().UnixNano()) - // get a random number for the image outlen,err := getArrayLen(out) random_img := rand.Intn(outlen) @@ -198,9 +195,6 @@ func get_imgur_image(sub string) <-chan string { return } - // randomize the seed for the random int - rand.Seed(time.Now().UnixNano()) - // get a random number for the image //outlen, _ := getArrayLen(out) //random_img := rand.Intn(outlen) @@ -244,9 +238,6 @@ func get_subreddit_image(sub string) <-chan string { return } - // randomize the seed for the random int - rand.Seed(time.Now().UnixNano()) - // make sure we aren't grabbing a text post by cylcing through looking for an image limit64, _ := jsonparser.GetInt(out, "data", "dist") limit := int(limit64) // convert from int64 to int