set

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 1 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{}

func New

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

func NewFromMap

func NewFromMap[T comparable, V any](items map[T]V) Set[T]

func NewFromSlice

func NewFromSlice[T comparable](items []T) Set[T]

func NewWithItems

func NewWithItems[T comparable](items ...T) Set[T]

func (Set[T]) Add

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

func (Set[T]) Contains

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

func (Set[T]) ContainsAll

func (s Set[T]) ContainsAll(other Set[T]) bool

func (Set[T]) ContainsSome

func (s Set[T]) ContainsSome(other Set[T]) bool

func (Set[T]) Copy

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

func (Set[T]) Difference

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

func (Set[T]) Equals

func (s Set[T]) Equals(other Set[T]) bool

func (Set[T]) Intersection

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

func (Set[T]) MarshalJSON

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

func (Set[T]) Remove

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

func (Set[T]) ToSlice

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

func (Set[T]) Union

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

func (*Set[T]) UnmarshalJSON

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