Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// You can edit this code!
// Click here and start typing.
package byteunits
const (
_ = iota
KB = 1 << (10 * iota)
MB
GB
TB
PB
EB
//overflow
// ZB
// YB
)
const (
SI_KB int = 1e3
SI_MB int = 1e6
SI_GB int = 1e9
SI_TB int = 1e12
SI_PB int = 1e15
SI_EB int = 1e18
//overflow
// SI_ZB int = 1e21
// SI_YB int = 1e24
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment