stringset

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stringset implements a basic set of strings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data represent a set of strings

func From

func From(strings []string) *Data

From create a empty set of strings given a slice of strings

func New

func New() *Data

New create a new empty set of strings

func (*Data) Delete

func (set *Data) Delete(key string)

Delete deletes a string from the set. If the string doesn't exist this is a no-op

func (*Data) Has

func (set *Data) Has(key string) bool

Has check if a string is in the set or not

func (*Data) Len

func (set *Data) Len() int

Len returns the map of the set

func (*Data) Put

func (set *Data) Put(key string)

Put a string in the set

func (*Data) ToList

func (set *Data) ToList() (result []string)

ToList returns the strings contained in this set as a string slice

Jump to

Keyboard shortcuts

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