stringset

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package stringset defines basic operation of set of strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringSet

type StringSet map[string]struct{}

StringSet is a set of strings.

func New

func New(strs []string) StringSet

New returns a StringSet of given strings.

func (StringSet) Diff

func (a StringSet) Diff(b StringSet) StringSet

Diff returns the difference of StringSet a and b.

func (StringSet) Elements

func (a StringSet) Elements() []string

Elements returns a sorted array of its elements.

func (StringSet) Equal

func (a StringSet) Equal(b StringSet) bool

Equal returns true if elements of a and b are the same.

func (StringSet) Has

func (a StringSet) Has(k string) bool

Has returns true if s is in StringSet a.

func (StringSet) Intersect

func (a StringSet) Intersect(b StringSet) StringSet

Intersect returns the intersection of StringSet a and b.

func (StringSet) String

func (a StringSet) String() string

String implements the Stringer interface for StringSet.

func (StringSet) Union

func (a StringSet) Union(b StringSet) StringSet

Union unions StringSet a and b.

Jump to

Keyboard shortcuts

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