xmaps

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package xmaps provides non-standard convenience map functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[K comparable, V any](seq iter.Seq2[K, V]) map[K][]V

Collect key-value pairs from seq into a new map and returning it, aggregating values for the same key (as opposed to replacing keys with new values).

Note: use CollectT in case you want to use a specific slice type other than []V.

func CollectT

func CollectT[T ~[]V, K comparable, V any](seq iter.Seq2[K, V]) map[K]T

Collect key-value paris from a seq into a new map with the specified value (slice) type T, aggregating values for the same key in slice type T. In contrast to Collect, CollectT allows explicitly specifying the slice type T the map should use for aggregating multiple values for the same key, as Go has no way to infer this type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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