Explorar o código

add WithoutDashString() method

xormplus %!s(int64=9) %!d(string=hai) anos
pai
achega
0295da78e1
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      uuid.go

+ 4 - 0
uuid.go

@@ -57,6 +57,10 @@ func (u *UUID) String() string {
 	return fmt.Sprintf("%x-%x-%x-%x-%x", u[0:4], u[4:6], u[6:8], u[8:10], u[10:])
 }
 
+func (u *UUID) WithoutDashString() string {
+	return fmt.Sprintf("%x", u[:])
+}
+
 func (u *UUID) variantRFC4122() {
 	u[8] = (u[8] & 0x3f) | 0x80
 }