util

package
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2025 License: MIT, MIT Imports: 0 Imported by: 0

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 type.

func Intersection

func Intersection[T comparable](a, b Set[T]) Set[T]

Intersection returns the intersection of two sets.

func NewSet

func NewSet[T comparable]() Set[T]

NewSet creates a new set.

func Union

func Union[T comparable](a, b Set[T]) Set[T]

Union returns the union of two sets.

func (Set[T]) Add

func (s Set[T]) Add(v T)

Add adds an element to the set.

func (Set[T]) Contains

func (s Set[T]) Contains(v T) bool

Contains checks if the set contains an element.

func (Set[T]) Remove

func (s Set[T]) Remove(v T)

Remove removes an element from the set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL