set

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 6 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 Merge added in v0.29.1

func Merge[T comparable](old, new Set[T]) Set[T]

Merge merges two sets, giving priority to the old set in case of conflicts. It will create a new set and leave the input sets unmodified.

func New added in v0.29.1

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

func (Set[T]) Add

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

func (Set[T]) Contains

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

func (Set[T]) MarshalJSON

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

func (Set[T]) Merge

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

Merge adds all elements from the other set into the current set.

func (Set[T]) Remove

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

func (Set[T]) TransformAsSlice

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

func (*Set[T]) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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