text

package
v0.6.3 Latest Latest
Warning

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

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

Documentation

Overview

Package text provides small string utilities shared across the codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateMiddle

func TruncateMiddle(s string, maxBytes int) string

TruncateMiddle returns s unchanged when its byte length fits within maxBytes. Otherwise it keeps a head and a tail of the input, joined by a "…N chars truncated…" marker, with the byte budget split evenly between head and tail at UTF-8 boundaries. The returned string may exceed maxBytes by the marker length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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