util

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](list []T, a T) bool

func FlatMapSliceValues

func FlatMapSliceValues[V any, V2 any](values []V, mapper func(V) []V2) []V2

func GetSortedMapValues

func GetSortedMapValues[T any](r map[string]T) []T

func MapSliceValues

func MapSliceValues[V any, V2 any](values []V, mapper func(V) V2) []V2

func MapSliceValuesErr added in v0.1.13

func MapSliceValuesErr[V any, V2 any](values []V, mapper func(V) (V2, error)) ([]V2, error)

func MapValues

func MapValues[K comparable, V any, V2 any](m map[K]V, mapper func(V) V2) map[K]V2

func MaxBy

func MaxBy[K constraints.Ordered, V any, P constraints.Ordered](r map[K]V, selector func(V) P) K

func SortResourcesById

func SortResourcesById[T any](r []T, idGetter func(T) string) []T

func SortedKeys added in v0.1.39

func SortedKeys[K constraints.Ordered, V any](m map[K]V) []K

Types

This section is empty.

Jump to

Keyboard shortcuts

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