maps

package
v0.0.0-...-a02f6fc Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSlice

func FromSlice[T any, K comparable, V any](ts []T, fn func(t T) (K, V)) map[K]V

func FromSliceGroups

func FromSliceGroups[T any, K comparable](ts []T, fn func(t T) K) map[K][]T

func FromSliceWithError

func FromSliceWithError[T any, K comparable, V any](ts []T, fn func(t T) (K, V, error)) (map[K]V, error)

func Keys

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

func MapValues

func MapValues[K comparable, V any, W any](m map[K]V, fn func(v V, k K) W) map[K]W

func ToSlice

func ToSlice[K comparable, V, T any](m map[K]V, fn func(k K, v V) T) []T

func ToSliceWithError

func ToSliceWithError[K comparable, V, T any](m map[K]V, fn func(k K, v V) (T, error)) ([]T, error)

func Values

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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