Documentation
¶
Index ¶
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 simple set implementation using a map with empty struct values.
func FromSlice ¶
func FromSlice[T comparable](vals []T) Set[T]
FromSlice returns a set built from vals. Only use this if the element order is irrelevant.
func New ¶
func New[T comparable](vals ...T) Set[T]
New returns a set containing the supplied values.
func (*Set[T]) AddAll ¶
func (s *Set[T]) AddAll(vals ...T)
AddAll inserts each supplied value into the set.
Click to show internal directories.
Click to hide internal directories.