We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 483774e commit 45ba668Copy full SHA for 45ba668
pkg/utils/units.go
@@ -3,8 +3,11 @@ package utils
3
// Binary size units
4
// See: http://en.wikipedia.org/wiki/Binary_prefix
5
const (
6
- KiB = 1024
7
- MiB = 1024 * KiB
8
- GiB = 1024 * MiB
9
- TiB = 1024 * GiB
+ _ = iota // ignore first value by assigning to blank identifier
+ KiB = 1 << (10 * iota) // 1 << (10*1)
+ MiB // 1 << (10*2)
+ GiB // 1 << (10*3)
10
+ TiB // 1 << (10*4)
11
+ PiB // 1 << (10*5)
12
+
13
)
0 commit comments