go.bigb.es/auxilia
Index
Types
type Set[T comparable] struct { // contains filtered or unexported fields }
NewSet creates an empty set with a capacity hint.
func NewSetFromListFunc[I any, T comparable](inp []I, f func(I) T) Set[T]
NewSetFromListFunc creates a set by applying f to each element of inp.
func (s *Set[T]) Add(key T) bool
Add inserts key into the set. It returns true if the key was newly added.
func (s Set[T]) Delete(key T) bool
Delete removes key from the set. It returns true if the key existed.
func (s Set[T]) Iterator() collect.ListIterator[T]
Iterator returns a collect.ListIterator over the set elements. The iteration order is not guaranteed.
Set is a generic set backed by map[T]struct{}.