From 8b2637353ba37f7f9629b283d59678ada985be2f Mon Sep 17 00:00:00 2001 From: Felipe Pinheiro Date: Wed, 26 Feb 2025 01:12:56 -0300 Subject: [PATCH] Return uint64 from exponentBase2 function (#753) A 32bit binary could not be built because `1 << 62` would overflow the return `uint` type, as it is an architecture dependent type. Closes #752 --- interceptors/retry/backoff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interceptors/retry/backoff.go b/interceptors/retry/backoff.go index fdc374bf..f6e9d320 100644 --- a/interceptors/retry/backoff.go +++ b/interceptors/retry/backoff.go @@ -27,7 +27,7 @@ func jitterUp(duration time.Duration, jitter float64) time.Duration { // exponentBase2 computes 2^(a-1) where a >= 1. If a is 0, the result is 1. // if a is greater than 62, the result is 2^62 to avoid overflowing int64 -func exponentBase2(a uint) uint { +func exponentBase2(a uint) uint64 { if a == 0 { return 1 }