set

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

Set contains a set of unique strings.

func New

func New() *Set

New creates a new Set.

func (*Set) Add

func (s *Set) Add(item string)

Add item to the Set.

Ignore item if it is empty.

func (*Set) Has

func (s *Set) Has(item string) bool

Has returns whether the Set contains item.

For convenience, strip the suffix '.' from item before checking. Optimized for domains, which may or may not contain a trailing period.

func (*Set) Len

func (s *Set) Len() int

Len returns the number of items in the Set.

func (*Set) Union

func (s *Set) Union(o *Set)

Union includes all elements of o into the Set.

Jump to

Keyboard shortcuts

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