summaryrefslogtreecommitdiff
path: root/pkg/btrfs/util.go
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
commit3825cf60fd652f22acc438d50028701d27a7402d (patch)
tree24b86afb8513891274dfaa8b982c4c94c1a65a5d /pkg/btrfs/util.go
parent2348cdbe2a3417990a2088f9e4e91adf0c45617d (diff)
wow
Diffstat (limited to 'pkg/btrfs/util.go')
-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
+}