diff options
Diffstat (limited to 'modules/util/util.go')
-rw-r--r-- | modules/util/util.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/util/util.go b/modules/util/util.go index 104c80f524..e99f951f21 100644 --- a/modules/util/util.go +++ b/modules/util/util.go @@ -38,3 +38,19 @@ func OptionalBoolOf(b bool) OptionalBool { } return OptionalBoolFalse } + +// Max max of two ints +func Max(a, b int) int { + if a < b { + return b + } + return a +} + +// Min min of two ints +func Min(a, b int) int { + if a > b { + return b + } + return a +} |