collections

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group[I any, K comparable] struct {
	Key     K
	Members []I
}

func GroupBy

func GroupBy[I any, K comparable](items []I, keyFn func(I) K) []Group[I, K]

GroupBy partitions items into groups by applying keyFn to each element. Groups are returned in the order their keys first appear in items.

Jump to

Keyboard shortcuts

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