diff options
Diffstat (limited to 'pkg/btrfs/internal/uuid.go')
-rw-r--r-- | pkg/btrfs/internal/uuid.go | 9 |
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) } |