Documentation ¶
Overview ¶
Sets and Set type and operations in go 1.18+ generics. (pending built in support in golang core)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveCommon ¶
func RemoveCommon[T comparable](a, b Set[T])
RemoveCommon removes elements from both sets that are in both, leaving only the delta. Useful for Notifier on Set so that oldValue has what has been removed and newValue has what has been added.
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
func FromSlice ¶
func FromSlice[T comparable](items []T) Set[T]
SetFromSlice constructs a Set from a slice.
func New ¶
func New[T comparable](item ...T) Set[T]
Click to show internal directories.
Click to hide internal directories.