Documentation ¶
Index ¶
- type Set
- func (s Set[T]) Add(items ...T)
- func (s Set[T]) Contains(v T) bool
- func (s Set[T]) Intersection(s2 Set[T]) Set[T]
- func (s Set[T]) MarshalJSON() ([]byte, error)
- func (s Set[T]) Remove(v T)
- func (s Set[T]) ToSlice() []T
- func (s Set[T]) Union(s2 Set[T]) Set[T]
- func (s *Set[T]) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[E comparable] map[E]struct{}
func New ¶
func New[T comparable](elems ...T) Set[T]
func (Set[T]) Intersection ¶
func (Set[T]) MarshalJSON ¶ added in v1.9.0
func (*Set[T]) UnmarshalJSON ¶ added in v1.9.0
Click to show internal directories.
Click to hide internal directories.