Popularity
3.8
Declining
Activity
0.0
Stable
27
24
11
Programming language: Go
License: BSD 3-clause "New" or "Revised" License
Tags:
Data Structures
set alternatives and similar packages
Based on the "Data Structures" category.
Alternatively, view set alternatives based on common mentions on social networks and blogs.
-
golang-set
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp. -
hyperloglog
HyperLogLog with lots of sugar (Sparse, LogLog-Beta bias correction and TailCut space reduction) brought to you by Axiom -
ttlcache
DISCONTINUED. An in-memory cache with item expiration and generics [Moved to: https://github.com/jellydator/ttlcache] -
Bloomfilter
DISCONTINUED. Face-meltingly fast, thread-safe, marshalable, unionable, probability- and optimal-size-calculating Bloom filter in go -
hilbert
DISCONTINUED. Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. -
cuckoo-filter
Cuckoo Filter go implement, better than Bloom Filter, configurable and space optimized 布谷鸟过滤器的Go实现,优于布隆过滤器,可以定制化过滤器参数,并进行了空间优化 -
go-rquad
:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go -
nan
Zero allocation Nullable structures in one library with handy conversion functions, marshallers and unmarshallers -
hide
A Go type to prevent internal numeric IDs from being exposed to clients using HashIDs and JSON.
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
Promo
coderabbit.ai
Do you think we are missing an alternative of set or a related project?
Popular Comparisons
README
Set
Set is a simple Set data structure implementation in Go (Golang) using LinkedHashMap.
This library allow you to get a set of int64
or string
without duplicated items.
Usage
package main
import (
"fmt"
"github.com/StudioSol/set"
)
func main() {
duplicatedInt64 := []int64{1, 1, 2, 2, 3, 3}
unduplicatedInt64 := set.NewLinkedHashSetINT64(duplicatedInt64...)
// Get a []int64 from set
unduplicatedArray := unduplicatedInt64.AsSlice()
fmt.Println(unduplicatedArray) // will print [1 2 3]
// Get the Length from set
fmt.Println(unduplicatedInt64.Length()) // will print 3
// Add new items in set
unduplicatedInt64.Add(1, 2, 3, 4)
fmt.Println(unduplicatedInt64.AsSlice()) // will print [1 2 3 4]
// Check if item is in set
fmt.Println(unduplicatedInt64.InArray(1)) // will print true
fmt.Println(unduplicatedInt64.InArray(5)) // will print false
// Get a []interface{} from set
interfaceList := unduplicatedInt64.AsInterface()
fmt.Println(interfaceList) // will print [1 2 3 4]
// Allow to iter over set
for i := range unduplicatedInt64.Iter() {
fmt.Println(i)
}
// Remove items from set
unduplicatedInt64.Remove(0, 1, 2, 3)
fmt.Println(unduplicatedInt64.AsSlice()) // will print [4]
}
// You have same methods to LinkedHashSetString