set

package
v0.1.1-0...-d6fc527 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strings

type Strings map[string]bool

Strings represents the classic "set" data structure, and contains strings.

func NewStrings

func NewStrings(initial ...string) Strings

NewStrings creates and initializes a Strings and populates it with initial values as specified in the parameters.

func (Strings) Add

func (s Strings) Add(value string)

Add puts a value into the set.

func (Strings) Contains

func (s Strings) Contains(value string) bool

Contains returns true if the value is in the set, and false otherwise.

func (Strings) Difference

func (s Strings) Difference(other Strings) Strings

Difference returns a new Strings representing all the values in the target that are not in the parameter.

func (Strings) Intersection

func (s Strings) Intersection(other Strings) Strings

Intersection returns a new Strings representing a intersection of the elments in the method target and the parameter.

func (Strings) IsEmpty

func (s Strings) IsEmpty() bool

IsEmpty is true for empty or uninitialized sets.

func (Strings) Remove

func (s Strings) Remove(value string)

Remove takes a value out of the set. If value wasn't in the set to start with, this method silently succeeds.

func (Strings) Size

func (s Strings) Size() int

Size returns the number of elements in the set.

func (Strings) SortedValues

func (s Strings) SortedValues() []string

SortedValues returns an ordered slice containing all the values in the set.

func (Strings) Union

func (s Strings) Union(other Strings) Strings

Union returns a new Strings representing a union of the elments in the method target and the parameter.

func (Strings) Values

func (s Strings) Values() []string

Values returns an unordered slice containing all the values in the set.

Jump to

Keyboard shortcuts

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