Documentation ¶
Overview ¶
Package stringset implements a set of strings.
Index ¶
- type Set
- func (set *Set) Add(v ...string) Set
- func (set Set) Contains(s string) bool
- func (set Set) Equal(other Set) bool
- func (set Set) Format(f fmt.State, c rune)
- func (set Set) GoString() string
- func (set Set) Join(sep string) string
- func (set Set) Len() int
- func (set Set) MarshalJSON() ([]byte, error)
- func (set Set) Remove(v ...string) Set
- func (set Set) String() string
- func (set *Set) UnmarshalJSON(data []byte) error
- func (set Set) Values() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set map[string]struct{}
Set is a set of strings.
func Add ¶
Add adds the values in v to the set and returns the set. If the set is nil, a new set is created.
func (*Set) Add ¶
Add adds the values in v to the set. If the set is nil a new set is created. Add returns set in order to support method chaining.
func (Set) Join ¶
Join concatenates the sorted elements of set to create a single string. The strings are sorted prior to concatenation. The separator string sep is placed between elements in the resulting string.
func (Set) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (Set) Remove ¶
Remove removes the values in v from the set. Remove returns set in order to support method chaining.
func (*Set) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.