Skip to content

Commit

Permalink
fix(units): iota units
Browse files Browse the repository at this point in the history
  • Loading branch information
berryhe committed Dec 13, 2021
1 parent 483774e commit 45ba668
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/utils/units.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

)

0 comments on commit 45ba668

Please sign in to comment.