set

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 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 interface{}

func NewAnySet

func NewAnySet(eq func(a interface{}, b interface{}) bool, aa ...interface{}) *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 interface{}) bool

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

func (*AnySet) Insert

func (s *AnySet) Insert(val interface{})

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 interface{})

Remove removes `val` from `s`

func (*AnySet) Slice

func (s *AnySet) Slice() []interface{}

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