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 generic set implementation using a map
func NewFromValues ¶
func NewFromValues[T comparable](vs ...T) Set[T]
NewFromValues creates a new set from the given values
func (Set[T]) Add ¶
Add returns true when the value is added; otherwise, false when it already exists in the set
func (Set[T]) Delete ¶
Delete removes the value from the set if it exists. Returns true if the value was deleted; otherwise, false
func (Set[T]) Has ¶
Has checks if the value exists in the set Returns true if the value exists; otherwise, false
Click to show internal directories.
Click to hide internal directories.