filter

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Regex

func Regex(pattern string, invert bool) (func(string) bool, error)

Regex returns a line filter that matches lines against the given pattern. If invert is true, non-matching lines are kept instead.

func Truncate

func Truncate(lines []string, maxLines int) []string

Truncate applies smart truncation to a list of lines:

  • Merges consecutive duplicate lines into "(repeated N times)" markers.
  • If lines exceed maxLines, keeps head and tail with an omission notice in between.
  • Tail-biased: 80% of the budget goes to the tail where errors typically appear.

maxLines <= 0 means no truncation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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