summaryrefslogtreecommitdiff
path: root/pkg/btrfs/internal/uuid.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-26 19:55:49 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-26 19:55:49 -0600
commit502cdc72771de93ce41e2a00bc201fc488603f59 (patch)
treed8b7bc9890d0f8f8069c70376220ab54daae52f7 /pkg/btrfs/internal/uuid.go
parente6b7c243462b1412390d0048dafe3430d07c05be (diff)
better volume!
Diffstat (limited to 'pkg/btrfs/internal/uuid.go')
-rw-r--r--pkg/btrfs/internal/uuid.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/btrfs/internal/uuid.go b/pkg/btrfs/internal/uuid.go
index cb2c800..ebfd247 100644
--- a/pkg/btrfs/internal/uuid.go
+++ b/pkg/btrfs/internal/uuid.go
@@ -21,6 +21,15 @@ func (uuid UUID) String() string {
}, "-")
}
+func (a UUID) Cmp(b UUID) int {
+ for i := range a {
+ if d := int(a[i]) - int(b[i]); d != 0 {
+ return d
+ }
+ }
+ return 0
+}
+
func (uuid UUID) Format(f fmt.State, verb rune) {
util.FormatByteArrayStringer(uuid, uuid[:], f, verb)
}