set

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: LGPL-3.0 Imports: 1 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]empty

StringSet is a set of strings, implemented via map[string]struct{} for minimal memory consumption.

func NewStringSet

func NewStringSet(items ...string) StringSet

NewStringSet creates a StringSet from a list of values.

func StringKeySet

func StringKeySet(theMap interface{}) StringSet

StringKeySet creates a StringSet from a keys of a map[string](? extends interface{}). If the value passed in is not actually a map, this will panic.

func (StringSet) Delete

func (s StringSet) Delete(items ...string) StringSet

Delete removes all items from the set.

func (StringSet) Has

func (s StringSet) Has(item string) bool

Has returns true if and only if item is contained in the set.

func (StringSet) Insert

func (s StringSet) Insert(items ...string) StringSet

Insert adds items to the set.

func (StringSet) Len

func (s StringSet) Len() int

Len returns the size of the set.

Jump to

Keyboard shortcuts

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