format

package
v0.37.0 Latest Latest
Warning

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

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

Documentation

Overview

Package format provides human-readable formatting utilities for bytes and durations. These functions are used across CLI output, progress reporting, and metrics display.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(bytes int64) string

Bytes formats a byte count as a human-readable string (e.g., "1.5 KB", "3.2 MB"). Uses binary units (1 KB = 1024 bytes).

func Duration

func Duration(d time.Duration) string

Duration formats a time.Duration as a human-readable string. Returns microseconds for sub-millisecond, milliseconds for sub-second, and seconds (with 2 decimal places) for longer durations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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