Documentation ¶
Index ¶
- func Copy[T1 comparable, T2 any](m map[T1]T2) map[T1]T2
- func Filter[T1 comparable, T2 any](m map[T1]T2, f func(T2) bool) map[T1]T2
- func Keys[T1 comparable, T2 any](m map[T1]T2) []T1
- func Merge[T1 comparable, T2 any](m1, m2 map[T1]T2) map[T1]T2
- func RandKeys[T1 comparable, T2 any](m map[T1]T2, r io.Reader) ([]T1, error)
- func Select[T1 comparable, T2 any](m map[T1]T2, kk []T1) (map[T1]T2, error)
- func Slice[T1 comparable, T2 any](m map[T1]T2) []T2
- func SortKeys[T1 comparable, T2 any](m map[T1]T2, sort func([]T1)) []T1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶ added in v0.9.0
func Copy[T1 comparable, T2 any](m map[T1]T2) map[T1]T2
Copy returns a shallow copy of the given map.
func Filter ¶ added in v0.12.0
func Filter[T1 comparable, T2 any](m map[T1]T2, f func(T2) bool) map[T1]T2
Filter returns a shallow copy of the given map with items that satisfy the predicate f.
func Keys ¶
func Keys[T1 comparable, T2 any](m map[T1]T2) []T1
Keys returns the slice of keys for the given map.
func Merge ¶ added in v0.10.2
func Merge[T1 comparable, T2 any](m1, m2 map[T1]T2) map[T1]T2
Merge returns a new map that contains all the elements of the given maps.
func RandKeys ¶ added in v0.13.10
func RandKeys[T1 comparable, T2 any](m map[T1]T2, r io.Reader) ([]T1, error)
RandKeys returns the slice of keys for the given map, sorted using given sorting function.
func Select ¶ added in v0.12.0
func Select[T1 comparable, T2 any](m map[T1]T2, kk []T1) (map[T1]T2, error)
Select returns a shallow copy of the given map with items that satisfy the predicate f and will fail when key is not present.
func Slice ¶ added in v0.11.0
func Slice[T1 comparable, T2 any](m map[T1]T2) []T2
Slice returns map values as a slice.
func SortKeys ¶ added in v0.9.0
func SortKeys[T1 comparable, T2 any](m map[T1]T2, sort func([]T1)) []T1
SortKeys returns the slice of keys for the given map, sorted using given sorting function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.