summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-05 16:46:34 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-05 16:46:34 -0600
commitbf2327276e6b3c8158a23362ca2fca5f46317e56 (patch)
tree7b45ba7c632a0932def8c9af9ecc98032bcfd2fa
parentea17fd8e1e05c4fe0a38fa7d763f0e91bc28b967 (diff)
factor out a btrfsmisc pacage
-rw-r--r--pkg/util/generic.go (renamed from pkg/btrfs/util.go)8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/btrfs/util.go b/pkg/util/generic.go
index 671d6fc..79096ab 100644
--- a/pkg/btrfs/util.go
+++ b/pkg/util/generic.go
@@ -1,10 +1,10 @@
-package btrfs
+package util
import (
"golang.org/x/exp/constraints"
)
-func inSlice[T comparable](needle T, haystack []T) bool {
+func InSlice[T comparable](needle T, haystack []T) bool {
for _, straw := range haystack {
if needle == straw {
return true
@@ -13,14 +13,14 @@ func inSlice[T comparable](needle T, haystack []T) bool {
return false
}
-func max[T constraints.Ordered](a, b T) T {
+func Max[T constraints.Ordered](a, b T) T {
if a > b {
return a
}
return b
}
-func min[T constraints.Ordered](a, b T) T {
+func Min[T constraints.Ordered](a, b T) T {
if a < b {
return a
}