modulepackage
0.0.0-20240927000941-0f3dac36c52b
Repository: https://github.com/alecthomas/units.git
Documentation: pkg.go.dev
# README
Units - Helpful unit multipliers and functions for Go
The goal of this package is to have functionality similar to the time package.
It allows for code like this:
n, err := ParseBase2Bytes("1KB")
// n == 1024
n = units.Mebibyte * 512
# Functions
No description provided by the author
ParseBase2Bytes supports both iB and B in base-2 multipliers.
ParseMetricBytes parses base-10 metric byte units.
ParseStrictBytes supports both iB and B suffixes for base 2 and metric, respectively.
No description provided by the author
No description provided by the author
# Constants
SI base-10 byte units.
Base-2 byte units.
SI unit multiples.
SI base-10 byte units.
Base-2 byte units.
SI base-10 byte units.
Base-2 byte units.
Base-2 byte units.
SI unit multiples.
SI base-10 byte units.
SI base-10 byte units.
Base-2 byte units.
Base-2 byte units.
SI unit multiples.
SI base-10 byte units.
SI base-10 byte units.
Base-2 byte units.
SI unit multiples.
SI base-10 byte units.
Base-2 byte units.
SI base-10 byte units.
Base-2 byte units.
SI unit multiples.
SI base-10 byte units.
Base-2 byte units.
SI base-10 byte units.
Base-2 byte units.
SI unit multiples.
SI base-10 byte units.
Base-2 byte units.
# Type aliases
Base2Bytes is the old non-SI power-of-2 byte scale (1024 bytes in a kilobyte, etc.).
MetricBytes are SI byte units (1000 bytes in a kilobyte).
SI units.