stringset

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

----------------------------------------------------------------------------

String Set

Author: William Shaffer Version: 07-May-2024

----------------------------------------------------------------------------

The stringset package contains implementations of sets for the string base type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringSet

type StringSet map[string]bool

func New

func New() StringSet

func (*StringSet) Add

func (set *StringSet) Add(value string)

Add inserts a string into the set. If the string is already in the set, there is no change.

func (*StringSet) AddAll

func (set *StringSet) AddAll(values []string)

AddAll inserts a collection of strings into the set.

func (*StringSet) Contains

func (set *StringSet) Contains(value string) bool

Contains returns true if the specified value is in the set.

func (*StringSet) Delete

func (set *StringSet) Delete(value string)

Delete deletes a string from the set. If the string is not in the set, nothing happens.

func (*StringSet) Equal

func (set *StringSet) Equal(another *StringSet) bool

Equal returns true if a set is equal to another set.

func (*StringSet) IsEmpty

func (set *StringSet) IsEmpty() bool

---------------------------------------------------------------------------- Methods ----------------------------------------------------------------------------

IsEmpty return true if the set has zero items.

func (*StringSet) Size

func (set *StringSet) Size() int

Size returns the number of items in the set.

func (*StringSet) ToSlice

func (set *StringSet) ToSlice() []string

ToSlice returns a slice with the strings in the set.

Jump to

Keyboard shortcuts

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