stringset

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringSet

type StringSet map[string]struct{}

A StringSet is a set of strings

func FromValues

func FromValues(values []string) StringSet

FromValues initializes a string set with values.

func New

func New() StringSet

New returns a new string set.

func (StringSet) Add

func (s StringSet) Add(itm string)

Add adds an item to the set.

func (StringSet) Contains

func (s StringSet) Contains(itm string) bool

Contains tests if the item is in the set.

func (StringSet) Equals

func (s StringSet) Equals(other StringSet) bool

Equals checks for set equality.

func (StringSet) Intersection

func (s StringSet) Intersection(other StringSet) StringSet

Intersection updates the current set to reflect the intersection between sets.

func (StringSet) Remove

func (s StringSet) Remove(itm string)

Remove removes an item from the set.

func (StringSet) Union

func (s StringSet) Union(other StringSet) StringSet

Union updates current string set to reflect the union between sets.

func (StringSet) Values

func (s StringSet) Values() []string

Values returns the values in the set.

Jump to

Keyboard shortcuts

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