diff options
author | EuAndreh <eu@euandre.org> | 2024-09-28 06:25:12 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-09-28 06:25:12 -0300 |
commit | 38b560d49f14ee0a3e05563d4a502705969120db (patch) | |
tree | 8367e1acbf5a671022da8b934d9c847f298499d9 /src/guuid.go | |
parent | src/guuid.go: Rename XxxError to ErrXxx (diff) | |
download | uuid-38b560d49f14ee0a3e05563d4a502705969120db.tar.gz uuid-38b560d49f14ee0a3e05563d4a502705969120db.tar.xz |
src/guuid.go: Remove "uuid" prefix from constants
Diffstat (limited to 'src/guuid.go')
-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 } |