github.com/m4gshm/gollections@v0.0.10/collection/group/api.go (about) 1 // Package group provides short aliases for functions that are used to group collection elements 2 package group 3 4 import ( 5 "github.com/m4gshm/gollections/c" 6 "github.com/m4gshm/gollections/iter" 7 "github.com/m4gshm/gollections/kv/stream" 8 ) 9 10 // Of - group.Of synonym of the iter.Group 11 func Of[T any, K comparable, IT c.Iterable[T]](elements IT, by func(T) K) stream.Iter[K, T, map[K][]T] { 12 return iter.Group(elements.Iter(), by) 13 }