From 0739cb4590b6eaf33fdd9a4e5946914845a6729d Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 28 Sep 2024 06:23:46 -0300 Subject: src/guuid.go: Rename XxxError to ErrXxx --- src/guuid.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/guuid.go') diff --git a/src/guuid.go b/src/guuid.go index 0d20021..267affb 100644 --- a/src/guuid.go +++ b/src/guuid.go @@ -16,16 +16,13 @@ const ( uuidEncodedLength = (UUIDByteCount * 2) + uuidDashCount ) - var ( dashIndexes = []int { 8, 13, 18, 23 } emptyUUID = UUID {} -) -var ( - BadLengthError = errors.New("guuid: str isn't of the correct length") - BadDashCountError = errors.New("guuid: Bad count of dashes in string") - BadDashPositionError = errors.New("guuid: Bad char in string") + ErrBadLength = errors.New("guuid: str isn't of the correct length") + ErrBadDashCount = errors.New("guuid: Bad count of dashes in string") + ErrBadDashPosition = errors.New("guuid: Bad char in string") ) @@ -85,16 +82,16 @@ func (uuid UUID) String() string { func FromString(str string) (UUID, error) { if len(str) != uuidEncodedLength { - return emptyUUID, BadLengthError + return emptyUUID, ErrBadLength } if strings.Count(str, "-") != uuidDashCount { - return emptyUUID, BadDashCountError + return emptyUUID, ErrBadDashCount } for _, idx := range dashIndexes { if str[idx] != '-' { - return emptyUUID, BadDashPositionError + return emptyUUID, ErrBadDashPosition } } -- cgit v1.2.3