Versions in this module Expand all Collapse all v1 v1.1.1 Mar 23, 2023 v1.0.1 Feb 21, 2023 v1.0.0 Feb 21, 2023 Changes in this version + const BinaryBase + const Byte + const ByteBase + const DecimalBase + const FormatDefault + const GB + const GiB + const GibiByte + const GigaByte + const KB + const KiB + const KibiByte + const KiloByte + const MB + const MebiByte + const MegaByte + const MiB + const PB + const PebiByte + const PetaByte + const PiB + const TB + const TebiByte + const TeraByte + const TiB + var BinarySizeRegexp = regexp.MustCompile(`(?m)^(\d+[\d\.]+?) ?([kKmMgGtTpPbB][iI][bB]?)$`) + var DecimalSizeRegexp = regexp.MustCompile(`(?m)^(\d+[\d\.]+?) ?([kKmMgGtTpPbB][bB]?)$`) + func FormatBinary(unit uint64) string + func FormatHuman(unit uint64) string + func FormatSize(format string, unit uint64, suffixes Suffixes) string + func FromBinarySize(size string) (uint64, error) + func FromHumanSize(size string) (uint64, error) + func FromSize(size string, units Units) (uint64, error) + func ParseSize(size string) (uint64, error) + type Suffix string + type Suffixes []... + type Units map[string]uint64