Fix lint issues from v1.62.0 upgrade (#20633)

* Fix lint issues from v1.62.0 upgrade

* Fix xlMetaV2TrimData version checks.
This commit is contained in:
Klaus Post
2024-11-11 06:51:43 -08:00
committed by GitHub
parent e6ca6de194
commit 4972735507
17 changed files with 89 additions and 88 deletions

View File

@@ -22,16 +22,16 @@ import (
"time"
)
func backoffWait(min, unit, cap time.Duration) func(*rand.Rand, uint) time.Duration {
func backoffWait(minSleep, unit, maxSleep time.Duration) func(*rand.Rand, uint) time.Duration {
if unit > time.Hour {
// Protect against integer overflow
panic("unit cannot exceed one hour")
}
return func(r *rand.Rand, attempt uint) time.Duration {
sleep := min
sleep := minSleep
sleep += unit * time.Duration(attempt)
if sleep > cap {
sleep = cap
if sleep > maxSleep {
sleep = maxSleep
}
sleep -= time.Duration(r.Float64() * float64(sleep))
return sleep