sizeparse

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sizeparse parses coreutils-style non-negative byte sizes.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid size")

ErrInvalid is returned for non-numeric, malformed, or out-of-range sizes.

View Source
var ErrRelative = errors.New("relative size operators not supported")

ErrRelative is returned when a size uses a relative-size operator.

Functions

func Parse

func Parse(s string) (int64, error)

Parse parses a non-negative byte count with an optional coreutils suffix.

For K/M/G/T the leading letter is case-insensitive; P/E are uppercase-only, matching GNU coreutils on 64-bit systems. Relative-size modifiers are rejected with ErrRelative so callers can surface a clearer message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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