Skip to content

Commit 7d53f9c

Browse files
committed
internal: do not use max as it conflicts with a built-in function
Revive complains about the use of `max` as variable name. go1.21 contains the `max()` function, so it is better to rename the variable. Signed-off-by: Niels de Vos <ndevos@ibm.com>
1 parent 95c5574 commit 7d53f9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/retry/sizer.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ type SizeFunc func(size int) (hint Hint)
4343
// DoubleSize or indicating a size not greater than the current size, the size
4444
// is doubled. If the hint or next size is greater than the max size, the max
4545
// size is used for a last retry.
46-
func WithSizes(size int, max int, f SizeFunc) {
47-
if size > max {
46+
func WithSizes(size int, maxSize int, f SizeFunc) {
47+
if size > maxSize {
4848
return
4949
}
5050
for {
5151
hint := f(size)
52-
if hint == nil || size == max {
52+
if hint == nil || size == maxSize {
5353
break
5454
}
5555
if hint.size() > size {
5656
size = hint.size()
5757
} else {
5858
size *= 2
5959
}
60-
if size > max {
61-
size = max
60+
if size > maxSize {
61+
size = maxSize
6262
}
6363
}
6464
}

0 commit comments

Comments
 (0)