Skip to content

Commit 8b26373

Browse files
authored
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
1 parent 8ce5e42 commit 8b26373

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interceptors/retry/backoff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func jitterUp(duration time.Duration, jitter float64) time.Duration {
2727

2828
// exponentBase2 computes 2^(a-1) where a >= 1. If a is 0, the result is 1.
2929
// if a is greater than 62, the result is 2^62 to avoid overflowing int64
30-
func exponentBase2(a uint) uint {
30+
func exponentBase2(a uint) uint64 {
3131
if a == 0 {
3232
return 1
3333
}

0 commit comments

Comments
 (0)