Documentation ¶
Index ¶
- type Set
- func (s Set[T]) Add(values ...T)
- func (s Set[T]) Clone() Set[T]
- func (s Set[T]) Contain(value T) bool
- func (s Set[T]) ContainAll(other Set[T]) bool
- func (s Set[T]) Delete(values ...T)
- func (s Set[T]) Equal(other Set[T]) bool
- func (s Set[T]) Intersection(other Set[T]) Set[T]
- func (s Set[T]) IsEmpty() bool
- func (s Set[T]) Iterate(fn func(value T))
- func (s Set[T]) Size() int
- func (s Set[T]) Union(other Set[T]) Set[T]
- func (s Set[T]) Values() []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]bool
Set is a data container, like slice, but element of set is not duplicate
func (Set[T]) ContainAll ¶
Contain checks if set contains other set
func (Set[T]) Intersection ¶
Intersection creates a new set whose element both be contained in set s and other
func (Set[T]) Iterate ¶
func (s Set[T]) Iterate(fn func(value T))
Iterate call function by every element of set
Click to show internal directories.
Click to hide internal directories.