Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
Set is a collection that only contains unique elements.
func MapSet ¶
func MapSet[G any, T comparable](c []G, f func(G) T) Set[T]
MapSet allows to map a collection to a Set using a closure to extract the values of type T.
func NewSetFrom ¶
func NewSetFrom[T comparable](elements ...T) Set[T]
NewSetFrom creates a Set from a list of elements.
func (Set[T]) Add ¶
func (s Set[T]) Add(e T)
Add stores a new element in the Set if wasn't contained yet.
Click to show internal directories.
Click to hide internal directories.