Skip to content

Commit

Permalink
Merge pull request #296 from skitt/deprecate-minmax
Browse files Browse the repository at this point in the history
Deprecate integer min/max functions
  • Loading branch information
k8s-ci-robot committed Sep 21, 2024
2 parents 702e33f + 3abbf95 commit 49e7df5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions integer/integer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,53 @@ package integer

import "math"

// IntMax returns the maximum of the params
// IntMax returns the maximum of the params.
// Deprecated: for new code, use the max() builtin instead.
func IntMax(a, b int) int {
if b > a {
return b
}
return a
}

// IntMin returns the minimum of the params
// IntMin returns the minimum of the params.
// Deprecated: for new code, use the min() builtin instead.
func IntMin(a, b int) int {
if b < a {
return b
}
return a
}

// Int32Max returns the maximum of the params
// Int32Max returns the maximum of the params.
// Deprecated: for new code, use the max() builtin instead.
func Int32Max(a, b int32) int32 {
if b > a {
return b
}
return a
}

// Int32Min returns the minimum of the params
// Int32Min returns the minimum of the params.
// Deprecated: for new code, use the min() builtin instead.
func Int32Min(a, b int32) int32 {
if b < a {
return b
}
return a
}

// Int64Max returns the maximum of the params
// Int64Max returns the maximum of the params.
// Deprecated: for new code, use the max() builtin instead.
func Int64Max(a, b int64) int64 {
if b > a {
return b
}
return a
}

// Int64Min returns the minimum of the params
// Int64Min returns the minimum of the params.
// Deprecated: for new code, use the min() builtin instead.
func Int64Min(a, b int64) int64 {
if b < a {
return b
Expand Down

0 comments on commit 49e7df5

Please sign in to comment.