sets

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 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 StringSet

type StringSet map[string]emptyStruct

StringSet is a set of unique strings.

func NewStringSet

func NewStringSet() StringSet

NewStringSet creates a new StringSet, pre-allocating a small starting size of memory.

func NewStringSetWithElements

func NewStringSetWithElements(vs ...string) StringSet

NewStringSetWithElements creates a new StringSet, pre-filled with all the given elements.

func NewStringSetWithSize

func NewStringSetWithSize(size int) StringSet

NewStringSetWithSize creates a new StringSet, pre-allocating the specified starting size of memory.

func (StringSet) Add

func (s StringSet) Add(v string)

Add adds v to the set.

func (StringSet) AddMany

func (s StringSet) AddMany(vs ...string)

AddMany adds all given elements to the set.

func (StringSet) Delete

func (s StringSet) Delete(v string)

Delete deletes v from the set.

func (StringSet) Has

func (s StringSet) Has(v string) bool

Has reports whether v is included in the set.

Jump to

Keyboard shortcuts

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