util

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](s []T, e T) bool

Contains checks if slice contains element.

func CopyMap

func CopyMap(m map[string]interface{}) map[string]interface{}

CopyMap returns a deep copy of the provided map.

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys returns slice of keys from map.

func Must added in v0.10.0

func Must[T any](v T, err error) T

func NullToEmpty

func NullToEmpty[T any](a []T) []T

NullToEmpty returns empty slice if provided slice is nil.

func SearchMap

func SearchMap(object map[string]any, path []string) (any, error)

SearchMap searches map for value at provided path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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