diff --git a/pkg/utils/units.go b/pkg/utils/units.go index f0e79293..feb8bff0 100644 --- a/pkg/utils/units.go +++ b/pkg/utils/units.go @@ -3,8 +3,11 @@ package utils // Binary size units // See: http://en.wikipedia.org/wiki/Binary_prefix const ( - KiB = 1024 - MiB = 1024 * KiB - GiB = 1024 * MiB - 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) + TiB // 1 << (10*4) + PiB // 1 << (10*5) + )