package
module
Version:
v0.0.0-...-c9e755d
Opens a new window with list of versions in this module.
Published: Sep 15, 2017
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
Package bytesize provides int64 wrapper type to aid with printing byte sizes
in human friendly format.
Bytes type implements fmt.Stringer interface printing number of bytes in
human-friendly form
fmt.Println(B * 512)
fmt.Println(Bytes(-1024))
fmt.Println(KiB + B*500)
fmt.Println(5 * MiB)
Output:
512B
-1.00KiB
1.49KiB
5.00MiB
const (
B Bytes = 1 << (10 * iota)
KiB
MiB
GiB
TiB
PiB
EiB
)
Constants for common sizes
Source Files
¶
Click to show internal directories.
Click to hide internal directories.