set

package
v0.0.0-...-c0326d0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 2 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[V comparable] map[V]struct{}

Set is a generic set data structure.

func New

func New[V comparable](vs ...V) Set[V]

New creates a new set from the given values.

func (Set[V]) Delete

func (s Set[V]) Delete(vs ...V) Set[V]

Delete removes the given values from the set.

func (Set[V]) Has

func (s Set[V]) Has(v V) bool

Has returns true if the set contains the given value.

func (Set[V]) Insert

func (s Set[V]) Insert(vs ...V) Set[V]

Insert adds the given values to the set.

func (Set[V]) Len

func (s Set[V]) Len() int

Len returns the length of the set.

func (Set[V]) Values

func (s Set[V]) Values() iter.Seq[V]

Values returns an iterator over all values in the set.

Jump to

Keyboard shortcuts

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