From 8f49c300fdd37fdff7df1e763c3dbb6d9ef1bfb6 Mon Sep 17 00:00:00 2001 From: Christian Stewart Date: Wed, 25 Dec 2019 19:10:02 -0800 Subject: [PATCH] Cast sz to uint32 to fix compilation on 32 bit `env GOOS=linux GOARCH=arm GOARM=7 go build` no longer fails with overflow. Similar to fb0cdb858c78004b9db8f08e91bb713780b20445. Signed-off-by: Christian Stewart --- value.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/value.go b/value.go index cdf575a29..5b9a655f0 100644 --- a/value.go +++ b/value.go @@ -856,7 +856,11 @@ func (lf *logFile) open(path string, flags uint32) error { return errFile(err, lf.path, "Unable to run file.Stat") } sz := fi.Size() - y.AssertTruef(sz <= math.MaxUint32, "file size: %d greater than %d", sz, math.MaxUint32) + y.AssertTruef( + sz <= math.MaxUint32, + "file size: %d greater than %d", + uint32(sz), uint32(math.MaxUint32), + ) lf.size = uint32(sz) if sz < vlogHeaderSize { // Every vlog file should have at least vlogHeaderSize. If it is less than vlogHeaderSize