summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-01 01:27:19 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-01 01:27:19 -0600
commitf0206e819032643299552998253b2fdf55c1b6bd (patch)
tree91f9f93e5945a19f9b8570b4f211e8aca404b4d7
parent9599d94470e0e82ae812edc83be8ae9c670e92a8 (diff)
wow
-rw-r--r--pkg/btrfs/util.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/btrfs/util.go b/pkg/btrfs/util.go
index 04462f8..312ec75 100644
--- a/pkg/btrfs/util.go
+++ b/pkg/btrfs/util.go
@@ -1,5 +1,9 @@
package btrfs
+import (
+ "golang.org/x/exp/constraints"
+)
+
func inSlice[T comparable](needle T, haystack []T) bool {
for _, straw := range haystack {
if needle == straw {
@@ -8,3 +12,10 @@ func inSlice[T comparable](needle T, haystack []T) bool {
}
return false
}
+
+func max[T constraints.Ordered](a, b T) T {
+ if a > b {
+ return a
+ }
+ return b
+}