set

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 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 Lookup

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

Lookup is a lookup map by given key.

func NewLookup

func NewLookup[T comparable](initialKeys ...T) Lookup[T]

NewLookup returns new ready to use lookup map.

func NewLookupCapped

func NewLookupCapped[T comparable](n int, initialKeys ...T) Lookup[T]

NewLookupCapped returns new ready to use lookup map with given map capacity.

func (Lookup[T]) Add

func (l Lookup[T]) Add(k T)

Add adds an element into lookup.

func (Lookup[T]) Clear

func (l Lookup[T]) Clear()

Clear removes all the elements from the lookup.

func (Lookup[T]) Delete

func (l Lookup[T]) Delete(k T)

Delete deletes an element from the lookup.

func (Lookup[T]) Has

func (l Lookup[T]) Has(k T) bool

Has returns true if lookup has given key.

Jump to

Keyboard shortcuts

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