Skip to content

Commit 465f28a

Browse files
paralinIbrahim Jarif
authored and
Ibrahim Jarif
committed
Cast sz to uint32 to fix compilation on 32 bit (#1175)
`env GOOS=linux GOARCH=arm GOARM=7 go build` no longer fails with overflow. Similar to commit fb0cdb8. Signed-off-by: Christian Stewart <[email protected]>
1 parent ea01d38 commit 465f28a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

value.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,11 @@ func (lf *logFile) open(path string, flags uint32) error {
856856
return errFile(err, lf.path, "Unable to run file.Stat")
857857
}
858858
sz := fi.Size()
859-
y.AssertTruef(sz <= math.MaxUint32, "file size: %d greater than %d", sz, math.MaxUint32)
859+
y.AssertTruef(
860+
sz <= math.MaxUint32,
861+
"file size: %d greater than %d",
862+
uint32(sz), uint32(math.MaxUint32),
863+
)
860864
lf.size = uint32(sz)
861865
if sz < vlogHeaderSize {
862866
// Every vlog file should have at least vlogHeaderSize. If it is less than vlogHeaderSize

0 commit comments

Comments
 (0)