Documentation ¶
Overview ¶
Package strset implements set functionality on top of map. It only supports sets of strings. Sets are not safe for concurrent use, just as maps on which they are based.
Example ¶
set := New() set.Add("foo", "bar", "baz") if set.Contains("bar") { fmt.Println("bar is here") } set.Del("baz") elements := set.AsSlice() sort.Strings(elements) fmt.Println(elements)
Output: bar is here [bar foo]
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set map[string]struct{}
Set represents a set of string values
func (Set) AsSlice ¶
AsSlice returns slice with all the values from the set. The order of values is not defined.
Click to show internal directories.
Click to hide internal directories.