summaryrefslogtreecommitdiff
path: root/src/util.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-01-12 03:01:24 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-01-12 03:18:40 +0900
commit7a2bc2cada971c7a390d09b0afda34780ff56fb6 (patch)
treecaa19fa8bf404a854c9e2cdf6eb08194e1733a6f /src/util.go
parent9dbf6b02d24b52ae43e36905bbb1e83087e1dfe9 (diff)
downloadfzf-7a2bc2cada971c7a390d09b0afda34780ff56fb6.tar.gz
Lint
Diffstat (limited to 'src/util.go')
-rw-r--r--src/util.go4
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 {