package
Version:
v0.0.0-...-f042742
Opens a new window with list of versions in this module.
Published: Nov 19, 2025
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Pair[First cmp.Ordered, Second any] struct {
First First
Second Second
}
func CollectMapToPairSlice[Key cmp.Ordered, Value any](m map[Key]Value) []Pair[Key, Value]
Set is a simple set implementation.
NewSet creates a set from given items.
func (s Set[K]) Add(item K)
Add adds an item to the set.
func (s Set[K]) Contains(item K) bool
Contains returns true if item exists in the set.
func (s Set[K]) Difference(other Set[K]) Set[K]
Difference returns a new set with the items that are in this set but not in other.
func (s Set[K]) Intersect(other Set[K]) Set[K]
Intersect returns a new set with items which are common between this set and the other set.
func (s Set[K]) Remove(item K)
Remove removes an item from the set.
func (s Set[K]) Slice() []K
Slice takes a copy of the items in the set and returns it as a slice.
The order of items is random.
Union returns a new set with all items in this set and the other set.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.