Skip to content

Commit 3abbf95

Browse files
committed
Deprecate integer min/max functions
Go 1.21 provides min/max builtins. New code going into other Kubernetes repositories (requiring Go 1.21 or later) should use those instead. Signed-off-by: Stephen Kitt <[email protected]>
1 parent b307cd5 commit 3abbf95

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

integer/integer.go

+12-6
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,53 @@ package integer
1818

1919
import "math"
2020

21-
// IntMax returns the maximum of the params
21+
// IntMax returns the maximum of the params.
22+
// Deprecated: for new code, use the max() builtin instead.
2223
func IntMax(a, b int) int {
2324
if b > a {
2425
return b
2526
}
2627
return a
2728
}
2829

29-
// IntMin returns the minimum of the params
30+
// IntMin returns the minimum of the params.
31+
// Deprecated: for new code, use the min() builtin instead.
3032
func IntMin(a, b int) int {
3133
if b < a {
3234
return b
3335
}
3436
return a
3537
}
3638

37-
// Int32Max returns the maximum of the params
39+
// Int32Max returns the maximum of the params.
40+
// Deprecated: for new code, use the max() builtin instead.
3841
func Int32Max(a, b int32) int32 {
3942
if b > a {
4043
return b
4144
}
4245
return a
4346
}
4447

45-
// Int32Min returns the minimum of the params
48+
// Int32Min returns the minimum of the params.
49+
// Deprecated: for new code, use the min() builtin instead.
4650
func Int32Min(a, b int32) int32 {
4751
if b < a {
4852
return b
4953
}
5054
return a
5155
}
5256

53-
// Int64Max returns the maximum of the params
57+
// Int64Max returns the maximum of the params.
58+
// Deprecated: for new code, use the max() builtin instead.
5459
func Int64Max(a, b int64) int64 {
5560
if b > a {
5661
return b
5762
}
5863
return a
5964
}
6065

61-
// Int64Min returns the minimum of the params
66+
// Int64Min returns the minimum of the params.
67+
// Deprecated: for new code, use the min() builtin instead.
6268
func Int64Min(a, b int64) int64 {
6369
if b < a {
6470
return b

0 commit comments

Comments
 (0)