truncate

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package truncate provides text truncation and formatting utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatArgs

func FormatArgs(args map[string]any, maxLen int) string

FormatArgs formats a map as a truncated key=value string. Example: {file: "foo.go", line: 42} -> `file="foo.go" line=42`.

func MapToJSON

func MapToJSON(m map[string]any) string

MapToJSON converts a map to indented JSON string.

func Truncate

func Truncate(s string, n int) string

Truncate truncates the string s to a maximum length of n bytes, appending "..." if truncation occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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