Documentation
¶
Index ¶
- type Set
- func (s *Set[T]) Add(value T)
- func (s *Set[T]) Clear()
- func (s *Set[T]) Contains(value T) bool
- func (s *Set[T]) Diff(sets ...*Set[T]) *Set[T]
- func (s *Set[T]) Remove(value T)
- func (s *Set[T]) Size() int
- func (s *Set[T]) Update(sets ...*Set[T])
- func (s *Set[T]) Values() []T
- func (s *Set[T]) ValuesSorted() []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
Set is a simple implementation of a set using a map.
func (*Set[T]) Diff ¶
Diff returns a new set containing elements that are in the current set but not in the provided sets.
func (*Set[T]) Values ¶
func (s *Set[T]) Values() []T
Values returns all elements in the set as a slice.
func (*Set[T]) ValuesSorted ¶
func (s *Set[T]) ValuesSorted() []T
ValuesSorted returns all elements in the set as a sorted slice.
Click to show internal directories.
Click to hide internal directories.