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
+4 -4
View File
@@ -2247,12 +2247,12 @@ func getEndpointsLocalAddr(endpointServerPools EndpointServerPools) string {
}
// fetches a random number between range min-max.
func getRandomRange(min, max int, seed int64) int {
func getRandomRange(minN, maxN int, seed int64) int {
// special value -1 means no explicit seeding.
if seed != -1 {
rand.Seed(seed)
if seed == -1 {
return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(maxN-minN) + minN
}
return rand.Intn(max-min) + min
return rand.New(rand.NewSource(seed)).Intn(maxN-minN) + minN
}
// Randomizes the order of bytes in the byte array