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.
Click to show internal directories.
Click to hide internal directories.