set

package
v0.0.0-...-98ab79b Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 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 Set

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

Set represents a set data structure.

func New

func New[T comparable](items ...T) 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.

Jump to

Keyboard shortcuts

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