stringset

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package stringset contains a simple set implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set map[string]struct{}

A Set is a compact set of strings.

func New

func New(init ...string) Set

New returns a new Set containing the given strings.

func (Set) Add

func (s Set) Add(strs ...string)

Add inserts each element of strs into s.

func (Set) Contains

func (s Set) Contains(str string) bool

Contains reports whether str is a member of s.

func (Set) Remove

func (s Set) Remove(str string)

Remove removes str from s, if it is present.

func (Set) Slice

func (s Set) Slice() []string

Slice returns a slice of the strings contained in s. The slice is ordered lexicographically.

Jump to

Keyboard shortcuts

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