Documentation
¶
Overview ¶
Package collections provides small, self-documenting generic container types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set is a collection of unique comparable elements. It replaces the ad-hoc map[T]bool idiom: membership is explicit, and a removed element is indistinguishable from one that was never present.
func (*Set[T]) Add ¶
func (s *Set[T]) Add(item T)
Add inserts item into the set. Adding an element already present is a no-op.
Click to show internal directories.
Click to hide internal directories.