Documentation ¶
Overview ¶
Package sets provides generic sets.
Index ¶
- type Set
- func (s Set[T]) Add(t ...T) Set[T]
- func (s Set[T]) AddSet(t Set[T]) Set[T]
- func (s Set[T]) Has(t T) bool
- func (s Set[T]) Intersect(t Set[T]) Set[T]
- func (s Set[T]) MarshalJSON() ([]byte, error)
- func (s Set[T]) Remove(t ...T) Set[T]
- func (s Set[T]) RemoveSet(t Set[T]) Set[T]
- func (s *Set[T]) UnmarshalJSON(b []byte) error
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 convenience wrapper around map[T]struct{}.
func (Set[T]) Intersect ¶
Intersect returns a new set holding the elements that are common to s and t.
func (Set[T]) MarshalJSON ¶ added in v0.1.13
MarshalJSON implements the json.Marshaler interface.
func (*Set[T]) UnmarshalJSON ¶ added in v0.1.13
UnmarshalJSON implements the json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.