set

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package set provides set data structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strings

type Strings map[string]struct{}

Strings is a set of strings.

func NewStrings

func NewStrings(strs ...string) Strings

NewStrings constructs Strings with given strs.

func (Strings) Add

func (s Strings) Add(str string)

Add adds given string.

func (Strings) AddSet

func (s Strings) AddSet(strs Strings)

AddSet adds values from another Strings object.

func (Strings) Contains

func (s Strings) Contains(str string) bool

Contains returns true if given string is in set, else false.

func (Strings) Len

func (s Strings) Len() int

Len returns the size of the set.

func (Strings) ToSlice

func (s Strings) ToSlice() []string

ToSlice returns a slice of values.

Jump to

Keyboard shortcuts

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