set

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT, Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[K comparable] map[K]struct{}

func New

func New[K comparable]() Set[K]

New creates a new instance.

func (Set[K]) Add

func (s Set[K]) Add(key K)

Add updates or inserts a value.

func (Set[K]) Contains

func (s Set[K]) Contains(key K) bool

Contains reports whether the condition holds.

func (Set[K]) Remove

func (s Set[K]) Remove(key K)

Remove removes or resets state.

func (Set[K]) ToSlice

func (s Set[K]) ToSlice() []K

ToSlice converts the value.

Jump to

Keyboard shortcuts

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