Categorygithub.com/raito-io/golang-set
module
0.0.4
Repository: https://github.com/raito-io/golang-set.git
Documentation: pkg.go.dev

# README

RAITO - GO set

Go Report CardVersion Build Coverage Contribute Go version Software License Go Reference

Introduction

This library introduce sets in golang.

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	
    }
}

# Packages

No description provided by the author