set

package
v0.0.0-...-407441d Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntSet

type IntSet map[int]bool

IntSet maintains a deduped list of strings added to it

func NewIntSet

func NewIntSet(intSlice []int) IntSet

NewIntSet initializes a set with the values form the input int slice

func (IntSet) Add

func (s IntSet) Add(val int)

Add a value to the set

func (IntSet) Has

func (s IntSet) Has(val int) bool

Has returns true if the value if found in the underlying set

func (IntSet) Keys

func (s IntSet) Keys() []int

Keys returns a slice of all keys in the set

func (IntSet) Remove

func (s IntSet) Remove(val int)

Remove a value from the set

type StringSet

type StringSet map[string]bool

StringSet maintains a deduped list of strings added to it

func NewStringSet

func NewStringSet(stringSlice []string) StringSet

NewStringSet initializes a set with the values form the input string slice

func (StringSet) Add

func (s StringSet) Add(val string)

Add a value to the set

func (StringSet) Has

func (s StringSet) Has(val string) bool

Has returns true if the value if found in the underlying set

func (StringSet) Keys

func (s StringSet) Keys() []string

Keys returns a slice of all keys in the set

func (StringSet) Remove

func (s StringSet) Remove(val string)

Remove a value from the set

Jump to

Keyboard shortcuts

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