collection

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MPL-2.0 Imports: 0 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set added in v1.66.0

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

Set holds a set of values.

func NewSet added in v1.66.0

func NewSet[T comparable](values ...T) Set[T]

NewSet creates a new set from its input values.

func (Set[T]) Add added in v1.66.0

func (s Set[T]) Add(values ...T)

Add values to the set.

func (*Set[T]) Clear added in v1.66.0

func (s *Set[T]) Clear()

Clear the set.

func (Set[T]) Clone added in v1.66.0

func (s Set[T]) Clone() Set[T]

Clone returns a copy of the set.

func (Set[T]) Contains added in v1.66.0

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

Contains returns true if the value exists within the set.

func (Set[T]) Empty added in v1.66.0

func (s Set[T]) Empty() bool

Empty returns true if there are no values in the set.

func (Set[T]) Len added in v1.66.0

func (s Set[T]) Len() int

Len returns the number of values in the set.

func (Set[T]) Values added in v1.66.0

func (s Set[T]) Values() []T

Values returns all values in the set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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