Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
func Collect[T comparable](s Set[T]) []T
Collects builds a slice containing all items in the set, in no particular order.
func Equal ¶
func Equal[S Set[T], T comparable](s1, s2 Set[T]) bool
Equal reports whether two sets contain the same values. Values are compared using ==.
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
Set is a collection of unique items.
To create a new set, use make(Set[T], cap).
func Append ¶
func Append[T comparable](s Set[T], values ...T) Set[T]
Append is the same as Add, but it creates a new set if s is nil.
Click to show internal directories.
Click to hide internal directories.