Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: skip Errorf for a frequent error that is never read #11208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -1592,14 +1592,16 @@
}
}

var ErrStorageDoesNotEncode32BitValue = errors.New("storage does not encode 32-bit value")

// Decode a uint32 encoded in Base64 in big-endian byte order.
func decodeUint32(b64 string) (uint32, error) {
d, err := base64.StdEncoding.DecodeString(b64)
if err != nil {
return 0, err
}
if len(d) != 4 {
return 0, fmt.Errorf("storage: %q does not encode a 32-bit value", d)
return 0, ErrStorageDoesNotEncode32BitValue
}
return uint32(d[0])<<24 + uint32(d[1])<<16 + uint32(d[2])<<8 + uint32(d[3]), nil
}
Expand Down Expand Up @@ -1648,7 +1650,7 @@
// Optional.
Delimiter string

// Prefix is the prefix filter to query objects

Check failure on line 1653 in storage/storage.go

View workflow job for this annotation

GitHub Actions / vet

exported var ErrStorageDoesNotEncode32BitValue should have comment or be unexported
// whose names begin with this prefix.
// Optional.
Prefix string
Expand Down
Loading