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

utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CsvPretty

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

Fails if the header is shorter than any of the rows

func CsvPrettyMap

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

func Filter

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

func Map2Cmp

func Map2Cmp[T any](m1, m2 map[string]map[string]T, cmp func(x1 T, x2 T) bool) bool

func MapCmp

func MapCmp[T any](m1, m2 map[string]T, cmp func(x1 T, x2 T) bool) bool

Returns whether m1 is equal to m2 (according to the "cmp" equality)

func MapGetOrPutDefault

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

func MapIncludes

func MapIncludes[T any](m1, m2 map[string]T, includes func(x1 T, x2 T) bool) bool

Returns whether m1 is a superset of m2

func MaxBigInt

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

func MinBigInt

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

func NestedMapGetOrPutDefault

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

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