package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Apr 30, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Set is an implementation of ISet using the builtin map type. Set is threadsafe.
New is the constructor for sets. It will pull from a reuseable memory pool if it can.
Takes a list of items to initialize the set with.
func (set *Set[T]) Add(items ...T)
Add will add the provided items to the set.
func (set *Set[T]) All(items ...T) bool
All returns a bool indicating if all of the supplied items exist in the set.
func (set *Set[T]) Clear()
Clear will remove all items from the set.
func (set *Set[T]) Dispose()
Dispose will add this set back into the pool.
func (set *Set[T]) Exists(item T) bool
Exists returns a bool indicating if the given item exists in the set.
func (set *Set[T]) Flatten() []T
Flatten will return a list of the items in the set.
Len returns the number of items in the set.
func (set *Set[T]) Remove(items ...T)
Remove will remove the given items from the set.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.