bytesize

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bytesize parses the human-readable sizes the CLI's size flags take ("512MiB", "1GiB", plain bytes), so the CLI and the load proofs that hand it the same figures read them with one parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(text string) (int64, error)

Parse reads text as a positive whole number of bytes with an optional binary unit (B, KiB, MiB, GiB, TiB; KB, MB, GB, TB are binary too), case insensitive, with surrounding and inner whitespace ignored. Every trailing letter is read as the unit, so an unknown unit is reported as typed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL