From bef33d0860b862629f7e6a5a3a26df997fcf9334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Tue, 10 Nov 2020 09:23:27 +0100 Subject: [PATCH] Fix tests on 32bit arch Closes: https://github.com/go-resty/resty/issues/386 --- retry.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/retry.go b/retry.go index 0b7c6ffe..7500b709 100644 --- a/retry.go +++ b/retry.go @@ -167,11 +167,8 @@ defaultCase: capLevel := float64(max) temp := math.Min(capLevel, base*math.Exp2(float64(attempt))) - ri := int(temp / 2) - if ri <= 0 { - ri = maxInt // max int for arch 386 - } - result := time.Duration(math.Abs(float64(ri + rand.Intn(ri)))) + ri := int64(temp / 2) + result := time.Duration(math.Abs(float64(ri + rand.Int63n(ri)))) if result < min { result = min