lib/storage: properly pass uint64 constant to fmt.Errorf on 32-bit platforms

This commit is contained in:
Aliaksandr Valialkin 2022-10-23 12:48:00 +03:00
parent 5e4dfe50c6
commit d0a9ca1bc2
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -462,7 +462,7 @@ func unmarshalMetricIDs(dst []uint64, src []byte) ([]uint64, error) {
}
n := encoding.UnmarshalUint64(src)
if n > ((1<<64)-1)/8 {
return dst, fmt.Errorf("unexpectedly high metricIDs len: %d bytes; must be lower than %d bytes", n, ((1<<64)-1)/8)
return dst, fmt.Errorf("unexpectedly high metricIDs len: %d bytes; must be lower than %d bytes", n, uint64(((1<<64)-1)/8))
}
src = src[8:]
if n*8 != uint64(len(src)) {