https://github.com/alecthomas/units
Helpful unit multipliers and functions for Go
https://github.com/alecthomas/units
Last synced: about 1 year ago
JSON representation
Helpful unit multipliers and functions for Go
- Host: GitHub
- URL: https://github.com/alecthomas/units
- Owner: alecthomas
- License: mit
- Created: 2014-07-04T06:35:45.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-11-25T00:12:17.000Z (over 1 year ago)
- Last Synced: 2025-04-10T00:03:20.715Z (over 1 year ago)
- Language: Go
- Size: 16.6 KB
- Stars: 127
- Watchers: 4
- Forks: 32
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/alecthomas/units)
# Units - Helpful unit multipliers and functions for Go
The goal of this package is to have functionality similar to the [time](http://golang.org/pkg/time/) package.
It allows for code like this:
```go
n, err := ParseBase2Bytes("1KB")
// n == 1024
n = units.Mebibyte * 512
```