format

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package format provides shared formatting utilities for consistent output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Size

func Size(bytes int64) string

Size converts bytes to human-readable format (e.g., "1.5 KB", "2.3 MB").

func Truncate

func Truncate(s string, maxLen int) string

Truncate shortens a string to maxLen characters, adding "..." if truncated. If the string is already within maxLen, it is returned unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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