Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 4737495

Browse files
memcodebien
andauthored
Fix 32-bit build (#158)
When trying to build for 32-bit ARM (linux/arm), you get: ``` pkg/remote/client.go:120:35: cannot use 0xffffffff (untyped int constant 4294967295) as int value in argument to fmt.Errorf (overflows) ``` Pass the constant as unsigned 64-bit integer, which is what the underlying snappy code is doing (it's casting the argument to an uint64 and comparing against 0xffffffff, which in Go means it's comparing against uint64(0xffffffff)). Since this is just an error message, it shouldn't matter, but let's be consistent. --------- Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com> Co-authored-by: codebien <2103732+codebien@users.noreply.github.com>
1 parent 7e717fb commit 4737495

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/remote/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"crypto/tls"
88
"fmt"
99
"io"
10+
"math"
1011
"net/http"
1112
"net/url"
1213
"time"
@@ -117,7 +118,7 @@ func newWriteRequestBody(series []*prompb.TimeSeries) ([]byte, error) {
117118
}
118119
if snappy.MaxEncodedLen(len(b)) < 0 {
119120
return nil, fmt.Errorf("the protobuf message is too large to be handled by Snappy encoder; "+
120-
"size: %d, limit: %d", len(b), 0xffffffff)
121+
"size: %d, limit: %d", len(b), math.MaxUint32)
121122
}
122123
return snappy.Encode(nil, b), nil
123124
}

0 commit comments

Comments
 (0)