Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶ added in v1.0.55
type Set[K comparable] interface { // Add adds the element(s) to the set Add(elements ...K) // Remove removes the element(s) from the set, if they are included Remove(elements ...K) // Exists returns true if the element exists in the set Exists(element K) bool // Elements returns the elements of the set as a slice of strings Elements() []K // Difference returns a new set containing the elements that are in this set but not in s Difference(s Set[K]) Set[K] // Size returns the size of the set Size() int // Empty returns true if this set is empty Empty() bool }
func NewSet ¶ added in v1.0.55
func NewSet[K comparable](elements ...K) Set[K]
NewSet returns a new Set for the given comparable type
type StringSet ¶
type StringSet interface { // Add adds the element(s) to the set Add(elements ...string) // Remove removes the element(s) from the set, if they are included Remove(elements ...string) // Exists returns true if the element exists in the set Exists(element string) bool // Elements returns the elements of the set as a slice of strings Elements() []string // Difference returns a new set containing the elements that are in this set but not in s Difference(s StringSet) StringSet // Size returns the size of the set Size() int // Empty returns true if this set is empty Empty() bool }
func NewStringSet ¶
NewStringSet returns a new StringSet
Click to show internal directories.
Click to hide internal directories.