stringset

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

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S

type S map[string]bool

func Intersect

func Intersect(a, b S) S

Intersect returns a new set representing strings that are in both a and b.

func New

func New(entries ...string) S

New returns a new stringset with the given entries.

func OfRunes

func OfRunes(runes string) S

OfRunes takes a string, and returns a stringset built by treating each rune as a separate entry.

func (S) AddAll

func (s S) AddAll(other S)

AddAll adds all the entries in `other` to this set.

func (S) Clone

func (s S) Clone() S

Clone returns a clone of the set.

func (S) ClonePlus

func (s S) ClonePlus(item string) S

ClonePlus returns a new set with the given item included.

func (S) ContainsAll

func (s S) ContainsAll(other S) bool

ContainsAll returns true if this set has every key in the other one.

func (S) ContainsAny

func (s S) ContainsAny(other S) bool

ContainsAny returns true if this set has any key in the other one.

func (S) Intersection

func (s S) Intersection(other S) S

Intersection returns a new set containing all items in both this and the other set.

func (S) Keys

func (s S) Keys() []string

Keys returns a sorted slice of all the strings in the set.

func (S) String

func (s S) String() string

String returns a clen string representation of the set.

func (S) Union

func (s S) Union(other S) S

Union returns a new set containing all items either in this or the other set or both.

Jump to

Keyboard shortcuts

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