format

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration

func Duration(d time.Duration) string

Duration formats a duration as HH:MM:SS or MM:SS.

func DurationHuman

func DurationHuman(d time.Duration) string

DurationHuman formats a duration for human display. Seconds are truncated when duration >= 1 minute. Examples: "2h", "30m", "1h30m", "45s"

func Size

func Size(bytes int64) string

Size formats a size in bytes for human display. Uses MB for sizes >= 1MB, KB for sizes >= 1KB, bytes otherwise. Sizes >= 1GB are displayed in MB (e.g., 10GB = "10240 MB").

Types

This section is empty.

Jump to

Keyboard shortcuts

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