Documentation
¶
Overview ¶
Package bytesize parses and formats byte counts written as size strings such as "32MiB".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format renders n with the largest binary unit that divides it exactly, so a value Parse accepted reads back the way it was written ("32MiB"). Other values print as bytes.
func Parse ¶
Parse reads a size such as "8MiB", "32 MiB", "512KiB", "1GiB" or a bare integer number of bytes. Units are the binary ones (KiB, MiB, GiB) and are case-insensitive; "B" is accepted for plain bytes. Decimal units (KB, MB) are refused rather than guessed, since they are routinely read both ways. The result must be positive and fit in an int64.
Types ¶
This section is empty.