diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/guuid.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/guuid.go b/src/guuid.go index 267affb..b8cf5fe 100644 --- a/src/guuid.go +++ b/src/guuid.go @@ -11,9 +11,9 @@ import ( const ( - UUIDByteCount = 16 - uuidDashCount = 4 - uuidEncodedLength = (UUIDByteCount * 2) + uuidDashCount + ByteCount = 16 + dashCount = 4 + encodedLength = (ByteCount * 2) + dashCount ) var ( @@ -27,7 +27,7 @@ var ( -type UUID [UUIDByteCount]byte +type UUID [ByteCount]byte @@ -56,7 +56,7 @@ func NewBytes() []byte { } func (uuid UUID) String() string { - dst := [uuidEncodedLength]byte { + dst := [encodedLength]byte { 0, 0, 0, 0, 0, 0, 0, 0, '-', @@ -81,11 +81,11 @@ func (uuid UUID) String() string { } func FromString(str string) (UUID, error) { - if len(str) != uuidEncodedLength { + if len(str) != encodedLength { return emptyUUID, ErrBadLength } - if strings.Count(str, "-") != uuidDashCount { + if strings.Count(str, "-") != dashCount { return emptyUUID, ErrBadDashCount } @@ -101,5 +101,5 @@ func FromString(str string) (UUID, error) { return emptyUUID, err } - return [UUIDByteCount]byte(data), nil + return [ByteCount]byte(data), nil } |