maps

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter[K comparable, V any](m map[K]V, predicate predicates.PredicateFunc[Entry[K, V]]) map[K]V

func FromEntries

func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V

func Map

func Map[K comparable, K2 comparable, V any, V2 any](m map[K]V, mapFunc func(Entry[K, V]) Entry[K2, V2]) map[K2]V2

func MapE

func MapE[K comparable, K2 comparable, V any, V2 any](m map[K]V, mapFunc func(Entry[K, V]) (Entry[K2, V2], error)) (map[K2]V2, error)

Types

type Entry

type Entry[K comparable, V any] struct {
	Key   K
	Value V
}

func ToSlice

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

Jump to

Keyboard shortcuts

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