Categorygithub.com/albrow/stringset
modulepackage
2.1.0+incompatible
Repository: https://github.com/albrow/stringset.git
Documentation: pkg.go.dev

# README

stringset

Version Circle CI GoDoc

A simple and space-effecient Go implementation of a set of strings.

Basic Usage

s := stringset.New()
s.Add("foo")
s.Add("bar", "baz")
fmt.Println(s)
// Output:
// [bar foo baz]

fmt.Println(s.Contains("foo"))
// Output:
// true

s.Remove("bar")
fmt.Println(s)
// Output:
// [foo]

# Functions

Diff returns a new set which contains all elements in a that are not in b.
Intersect returns a new set which contains only elements that are in both a and b.
New returns an initialized Set.
NewFromSlice returns a new set constructed from the given slice.
Union returns a new set which contains all elements that are in either a or b.

# Type aliases

Set is an unsorted set of unique strings.