Help us shape the future of Go! Take the 2026 Go Developer Survey

set

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

func New

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

func (Set[T]) Add

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

func (Set[T]) Contains

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

func (Set[T]) Intersection

func (s Set[T]) Intersection(s2 Set[T]) Set[T]

func (Set[T]) MarshalJSON added in v1.9.0

func (s Set[T]) MarshalJSON() ([]byte, error)

func (Set[T]) Remove

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

func (Set[T]) ToSlice

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

func (Set[T]) Union

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

func (*Set[T]) UnmarshalJSON added in v1.9.0

func (s *Set[T]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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