diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 03:01:24 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 03:18:40 +0900 |
| commit | 7a2bc2cada971c7a390d09b0afda34780ff56fb6 (patch) | |
| tree | caa19fa8bf404a854c9e2cdf6eb08194e1733a6f /src/util.go | |
| parent | 9dbf6b02d24b52ae43e36905bbb1e83087e1dfe9 (diff) | |
| download | fzf-7a2bc2cada971c7a390d09b0afda34780ff56fb6.tar.gz | |
Lint
Diffstat (limited to 'src/util.go')
| -rw-r--r-- | src/util.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.go b/src/util.go index de6f3654..5461705f 100644 --- a/src/util.go +++ b/src/util.go @@ -2,6 +2,7 @@ package fzf import "time" +// Max returns the largest integer func Max(first int, items ...int) int { max := first for _, item := range items { @@ -12,6 +13,7 @@ func Max(first int, items ...int) int { return max } +// Max32 returns the largest 32-bit integer func Max32(first int32, second int32) int32 { if first > second { return first @@ -19,6 +21,7 @@ func Max32(first int32, second int32) int32 { return second } +// Min returns the smallest integer func Min(first int, items ...int) int { min := first for _, item := range items { @@ -29,6 +32,7 @@ func Min(first int, items ...int) int { return min } +// DurWithin limits the given time.Duration with the upper and lower bounds func DurWithin( val time.Duration, min time.Duration, max time.Duration) time.Duration { if val < min { |
