From 7d53f9cded659e7cb33d2b7e8c2dd81dc3690597 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 7 Jan 2025 15:14:30 +0100 Subject: [PATCH] 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 --- internal/retry/sizer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/retry/sizer.go b/internal/retry/sizer.go index 5b27e51030..df427cf03e 100644 --- a/internal/retry/sizer.go +++ b/internal/retry/sizer.go @@ -43,13 +43,13 @@ type SizeFunc func(size int) (hint Hint) // DoubleSize or indicating a size not greater than the current size, the size // is doubled. If the hint or next size is greater than the max size, the max // size is used for a last retry. -func WithSizes(size int, max int, f SizeFunc) { - if size > max { +func WithSizes(size int, maxSize int, f SizeFunc) { + if size > maxSize { return } for { hint := f(size) - if hint == nil || size == max { + if hint == nil || size == maxSize { break } if hint.size() > size { @@ -57,8 +57,8 @@ func WithSizes(size int, max int, f SizeFunc) { } else { size *= 2 } - if size > max { - size = max + if size > maxSize { + size = maxSize } } }