Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CsvPretty added in v0.0.19

func CsvPretty(
	header []string,
	rows [][]string,
	sortRows bool,
) string

Fails if the header is shorter than any of the rows

func CsvPrettyMap added in v0.0.19

func CsvPrettyMap(keyName string, valueName string, m map[string]string) string

func CsvPrettyOmitEmptyCols added in v0.0.25

func CsvPrettyOmitEmptyCols(
	header []string,
	rows [][]string,
	sortRows bool,
) string

CsvPrettyOmitEmptyCols renders the table like CsvPretty, but omits any column whose data cells are all empty (its header is dropped along with it). This lets callers always pass the full set of columns and have the optional ones (e.g. a color or scope dimension that no row populates) disappear automatically.

Fails if the header is shorter than any of the rows.

func Filter added in v0.0.15

func Filter[T any](slice []T, predicate func(x T) bool) []T

func MapGetOrPutDefault added in v0.0.19

func MapGetOrPutDefault[T any](m map[string]T, key string, getDefault func() T) T

func MaxBigInt added in v0.0.11

func MaxBigInt(a *big.Int, b *big.Int) *big.Int

func MinBigInt

func MinBigInt(a *big.Int, b *big.Int) *big.Int

func NestedMapGetOrPutDefault added in v0.0.19

func NestedMapGetOrPutDefault[T any](m map[string]map[string]T, key1 string, key2 string, getDefault func() T) T

func NonExhaustiveMatchPanic

func NonExhaustiveMatchPanic[T any](value any) T

func NonNeg added in v0.0.17

func NonNeg(a *big.Int) *big.Int

Types

This section is empty.

Jump to

Keyboard shortcuts

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