Documentation
¶
Overview ¶
Package set provides a generic set data structure implementation.
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 generic set data structure that stores unique values of any comparable type.
func NewSet ¶
func NewSet[T comparable](vs ...T) Set[T]
NewSet creates and returns a new Set containing the provided values. Duplicate values in the input are automatically deduplicated.
func (Set[T]) Add ¶
func (s Set[T]) Add(vs ...T)
Add adds one or more values to the set. If a value already exists in the set, it is not added again.
Click to show internal directories.
Click to hide internal directories.