set

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnySet

type AnySet struct {
	// contains filtered or unexported fields
}

AnySet is a set stores any

func NewAnySet

func NewAnySet(eq func(a any, b any) bool, aa ...any) *AnySet

NewAnySet builds a AnySet

func (*AnySet) Difference

func (s *AnySet) Difference(rhs *AnySet) *AnySet

Difference returns the difference of two sets

func (*AnySet) Exist

func (s *AnySet) Exist(val any) bool

Exist checks whether `val` exists in `s`.

func (*AnySet) Insert

func (s *AnySet) Insert(val any)

Insert inserts `val` into `s`.

func (*AnySet) Intersection

func (s *AnySet) Intersection(rhs *AnySet) *AnySet

Intersection returns the intersection of two sets

func (*AnySet) Remove

func (s *AnySet) Remove(val any)

Remove removes `val` from `s`

func (*AnySet) Slice

func (s *AnySet) Slice() []any

Slice converts the set to a slice

type StringSet

type StringSet map[string]struct{}

StringSet is a string set.

func NewStringSet

func NewStringSet(ss ...string) StringSet

NewStringSet builds a string set.

func (StringSet) Difference

func (s StringSet) Difference(rhs StringSet) StringSet

Difference returns the difference of two sets

func (StringSet) Exist

func (s StringSet) Exist(val string) bool

Exist checks whether `val` exists in `s`.

func (StringSet) Insert

func (s StringSet) Insert(val string)

Insert inserts `val` into `s`.

func (StringSet) Intersection

func (s StringSet) Intersection(rhs StringSet) StringSet

Intersection returns the intersection of two sets

func (StringSet) Join

func (s StringSet) Join(add StringSet) StringSet

Join add all elements of `add` to `s`.

func (StringSet) Remove

func (s StringSet) Remove(val string)

Remove removes `val` from `s`

func (StringSet) Slice

func (s StringSet) Slice() []string

Slice converts the set to a slice

Jump to

Keyboard shortcuts

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