utils

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 5 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NumberNormalizer = cmp.FilterValues(func(x, y interface{}) bool {
	return IsNumber(x) || IsNumber(y)
}, cmp.Transformer("NormalizeNumbers", func(in interface{}) string {
	return fmt.Sprintf("%v", in)
}))

NumberNormalizer normalizes different number types (e.g. float64 vs int64) by converting them to their string representation

Functions

func ContainsString

func ContainsString(list []string, s string) bool

func DefaultContext

func DefaultContext() (context.Context, context.CancelFunc)

func Difference

func Difference(a, b []string) (diff []string)

func IsNumber

func IsNumber(x interface{}) bool

func Min

func Min(x, y int) int

func Omit

func Omit(value map[string]string, ignoredKeys ...string) map[string]string

Omit returns a copy of the given map with the given keys left out

Types

This section is empty.

Jump to

Keyboard shortcuts

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