go get github.com/fgrzl/collectionsimport "github.com/fgrzl/collections/hashset"
set := hashset.NewHashSet[string](hashset.WithCapacity(64))
set.Add("alpha")
set.Add("beta")
if set.Contains("alpha") {
// ...
}Or via the root package:
import "github.com/fgrzl/collections"
set := collections.NewHashSetWithCapacity[string](64)import "github.com/fgrzl/collections/queue"
q := queue.NewQueue[int]()
q.Enqueue(1)
q.Enqueue(2)
q.Enqueue(3)
v, ok := q.Dequeue() // 1, trueimport "github.com/fgrzl/collections/stack"
s := stack.NewStack[string]()
s.Push("bottom")
s.Push("top")
v, ok := s.Pop() // "top", trueimport "github.com/fgrzl/collections/concurrenthashset"
set := concurrenthashset.NewConcurrentHashSet[int]()
set.Add(42)go test ./...