stringset

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.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]struct{}

StringSet is string container in which every string is contained at most once i.e. a set data structure.

func New

func New(elems ...string) StringSet

New builds a string set with elements from a given slice.

func NewWithCap

func NewWithCap(cap int) StringSet

NewWithCap builds an empty string set with a given capacity.

func (StringSet) Add

func (set StringSet) Add(elems ...string)

Add inserts a string to the set.

func (StringSet) Contains

func (set StringSet) Contains(str string) bool

Contains checks if the set includes a given string.

func (StringSet) Del

func (set StringSet) Del(str string)

Del removes a string from the set.

func (StringSet) Len

func (set StringSet) Len() int

Len returns a set size.

func (StringSet) ToSlice

func (set StringSet) ToSlice() []string

ToSlice returns a slice with set contents.

Jump to

Keyboard shortcuts

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