set

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[T constraints.Ordered] map[T]struct{}

func New

func New[T constraints.Ordered](items []T) *Set[T]

func (*Set[T]) Add

func (s *Set[T]) Add(item T)

func (*Set[T]) Clear

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

func (*Set[T]) Contains

func (s *Set[T]) Contains(items *Set[T]) bool

func (*Set[T]) ContainsAny

func (s *Set[T]) ContainsAny(items *Set[T]) bool

func (*Set[T]) Delete

func (s *Set[T]) Delete(item T)

func (*Set[T]) Has

func (s *Set[T]) Has(item T) bool

func (*Set[T]) Len

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

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

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

func (*Set[T]) MarshalYAML added in v1.0.3

func (s *Set[T]) MarshalYAML() (interface{}, error)

func (*Set[T]) Slice

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

func (*Set[T]) SliceAny

func (s *Set[T]) SliceAny() []any

func (*Set[T]) UnmarshalJSON

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

func (*Set[T]) UnmarshalYAML

func (s *Set[T]) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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