idset

package
v0.0.0-...-f77d0db Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: 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 SetOf

type SetOf[T comparable] map[T]struct{}

SetOf is a set of IDs of type T.

func (SetOf[T]) Add

func (set SetOf[T]) Add(id T)

Add adds the given id to the set. If it is already present, it takes no action.

func (SetOf[T]) Contains

func (set SetOf[T]) Contains(id T) bool

Contains returns true if the given id is present in the set.

func (SetOf[T]) Remove

func (set SetOf[T]) Remove(id T)

Remove removes the given id from the set. If it is not present, it takes no action.

Jump to

Keyboard shortcuts

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