Documentation
¶
Index ¶
- type Set
- func (s Set[T]) Add(item T)
- func (s Set[T]) Contains(item T) bool
- func (s Set[T]) Difference(other Set[T]) Set[T]
- func (s Set[T]) Intersection(other Set[T]) Set[T]
- func (s Set[T]) Items() []T
- func (s Set[T]) Len() int
- func (s Set[T]) Remove(item T)
- func (s Set[T]) SymmetricDifference(other Set[T]) Set[T]
- func (s Set[T]) Union(other Set[T]) Set[T]
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 implementation
func (Set[T]) Difference ¶
Difference returns a new set containing all items in the first set that are not in the second set
func (Set[T]) Intersection ¶
Intersection returns a new set containing all items common to both sets
func (Set[T]) SymmetricDifference ¶
SymmetricDifference returns a new set containing all items in either set, but not both
Click to show internal directories.
Click to hide internal directories.