set

package
v2.0.0-...-c472316 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 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 represents a set data structure.

func New

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

New returns an initialized set.

func (Set[T]) Add

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

Add adds item into the set s.

func (Set[T]) Contains

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

Contains returns true if the set s contains item.

func (Set[T]) Delete

func (s Set[T]) Delete(item T)

Delete deletes an item from the set.

Jump to

Keyboard shortcuts

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