From d18768986e875753baf7b79f282cc05ba7e66294 Mon Sep 17 00:00:00 2001 From: Keith Peters Date: Sat, 1 Jan 2022 15:53:29 -0500 Subject: [PATCH] fix random int range --- random/random.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/random/random.go b/random/random.go index a160c5a..af9f9f3 100644 --- a/random/random.go +++ b/random/random.go @@ -35,8 +35,7 @@ func FloatRange(min float64, max float64) float64 { // IntRange returns a random int from min to max. func IntRange(min int, max int) int { - randRange := float64(max - min) - return min + int(math.Round(rand.Float64()*randRange)) + return int(FloatRange(float64(min), float64(max))) } // Boolean returns a random boolean.