summaryrefslogtreecommitdiff
path: root/pkg/btrfs/uuid.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-05-11 12:34:18 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-05-11 12:34:18 -0600
commit3179489ad6498e3d8b2b7948d93cee4efa01049f (patch)
treed999166ab0c19c1e0485afe08e345989f6c4f672 /pkg/btrfs/uuid.go
parent7e9213c75b9361c174f4662ff3feb4104d2c8f07 (diff)
move to pkg/btrfs, get CRC working
Diffstat (limited to 'pkg/btrfs/uuid.go')
-rw-r--r--pkg/btrfs/uuid.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/btrfs/uuid.go b/pkg/btrfs/uuid.go
new file mode 100644
index 0000000..5218a3f
--- /dev/null
+++ b/pkg/btrfs/uuid.go
@@ -0,0 +1,19 @@
+package btrfs
+
+import (
+ "encoding/hex"
+ "strings"
+)
+
+type UUID [16]byte
+
+func (uuid UUID) String() string {
+ str := hex.EncodeToString(uuid[:])
+ return strings.Join([]string{
+ str[:8],
+ str[8:12],
+ str[12:16],
+ str[16:20],
+ str[20:32],
+ }, "-")
+}