Set is a container that store unique elements in no particular order.
Sets are an alias for map[T]struct{} where T is a comparable type.
Getting Started
Add this library as a dependency via go get github.com/raito-io/golang-set
Examples
import github.com/raito-io/golang-set/set
func Foo() {
var a set.Set[int]
a = set.NewSet[int](2, 5, 9, 7)
l := len(a) //l = 4
contains := a.Contains(4) //false
for i := range(a) {
//loop over all elements in the set
}
}