size
is a package for working with byte capacities similar to time.Duration
.
// Returns a Capacity which is a uint64 representing
// 5 gigabytes in bytes.
5*size.Gigabyte
// Turn the string "5G" into a Capacity
// Useful for parsing from flags.
size.ParseCapacity("5G")
$ go get github.com/mattrobenolt/size