Skip to content

Commit 892a10e

Browse files
committed
Fixed build
Signed-off-by: Vishal Rana <[email protected]>
1 parent 2219395 commit 892a10e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bytes/bytes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ func format(b float64, bin bool) string {
2525
if b < unit {
2626
return fmt.Sprintf("%.0f B", b)
2727
} else {
28-
i := uint8(math.Floor(math.Log(b) / math.Log(unit)))
28+
x := math.Floor(math.Log(b) / math.Log(unit))
2929
pre := make([]byte, 1, 2)
30-
pre[0] = "KMGTPE"[i-1]
30+
pre[0] = "KMGTPE"[uint8(x)-1]
3131
if bin {
3232
pre = pre[:2]
3333
pre[1] = 'i'
3434
}
35-
return fmt.Sprintf("%.02f %sB", b/math.Pow(unit, i), pre)
35+
return fmt.Sprintf("%.02f %sB", b/math.Pow(unit, x), pre)
3636
}
3737
}

0 commit comments

Comments
 (0)