collection

package
v4.0.7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: BSD-3-Clause Imports: 2 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 cmp.Ordered] map[T]struct{}

func NewSet

func NewSet[T cmp.Ordered](vs ...T) Set[T]

func (Set[T]) Add

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

func (Set[T]) AddAll

func (s Set[T]) AddAll(vs ...T) Set[T]

func (Set[T]) Contains

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

func (Set[T]) Sorted

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

Sorted returns the set as a sorted slice.

func (Set[T]) Union

func (s Set[T]) Union(other Set[T]) Set[T]

Jump to

Keyboard shortcuts

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