maps

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 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, fil filters.Filter) map[K]V

Filter filters a map by applying a filter function to each key-value pair. Only the entries for which the filter function returns true are kept in the copy. The original map is not modified. Passes the key as first and the value as second argument into the filter function. Note that the values are not deep-copied. This is a convience alias for filters.FilterMap.

func Intersect

func Intersect[K comparable, V any](source map[K]V, maps ...map[K]V) map[K]V

Intersect takes one source and any number of comparison maps and returns a new map containing only the entries of source for which keys exist in all comparison maps. The original maps are not modified. Note that the values are not deep-copied.

func Merge

func Merge[K comparable, V any](maps ...map[K]V) map[K]V

Merge merges multiple maps into a single one. The original maps are not modified. Note that the values are not deep-copied. If multiple maps contain the same key, the value from the last map in the list is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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