Popularity
1.3
Growing
Activity
1.1
Growing
7
3
2
Programming language: Go
License: MIT License
Tags:
Data Structures
slices alternatives and similar packages
Based on the "Data Structures" category.
Alternatively, view slices alternatives based on common mentions on social networks and blogs.
-
gods
GoDS (Go Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more -
go-datastructures
A collection of useful, performant, and threadsafe Go datastructures. -
golang-set
A simple generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp. -
boomfilters
Probabilistic data structures for processing continuous, unbounded streams. -
gocache
☔️ A complete Go cache library that brings you multiple ways of managing your caches -
hyperloglog
HyperLogLog with lots of sugar (Sparse, LogLog-Beta bias correction and TailCut space reduction) -
trie
Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching. -
gostl
Data structure and algorithm library for go, designed to provide functions similar to C++ STL -
go-geoindex
Go native library for fast point tracking and K-Nearest queries -
ttlcache
An in-memory cache with item expiration and generics [Moved to: https://github.com/jellydator/ttlcache] -
Bloomfilter
Face-meltingly fast, thread-safe, marshalable, unionable, probability- and optimal-size-calculating Bloom filter in go -
hilbert
Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. -
go-adaptive-radix-tree
Adaptive Radix Trees implemented in Go -
cuckoo-filter
Cuckoo Filter go implement, better than Bloom Filter, configurable and space optimized 布谷鸟过滤器的Go实现,优于布隆过滤器,可以定制化过滤器参数,并进行了空间优化 -
goconcurrentqueue
Go concurrent-safe, goroutine-safe, thread-safe queue -
ring
Package ring provides a high performance and thread safe Go implementation of a bloom filter. -
go-rquad
:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go -
set
A simple Set data structure implementation in Go (Golang) using LinkedHashMap. -
nan
Zero allocation Nullable structures in one library with handy conversion functions, marshallers and unmarshallers -
goset
Set is a useful collection but there is no built-in implementation in Go lang. -
hide
ID type with marshalling to/from hash to prevent sending IDs to clients.
Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
Promo
scoutapm.com
Do you think we are missing an alternative of slices or a related project?
README
Slices
Functions that operate on slices. Similar to functions from package strings
or package bytes
that have been adapted to work with slices.
Features
- [x] Using a thin layer of idiomatic Go; correctness over performance.
- [x] Provide most basic slice operations: index, trim, filter, map
- [x] Some PHP favorites like: pop, push, shift, unshift, shuffle, etc...
- [x] Non-destructive returns (won't alter original slice), except for explicit tasks.
Quick Start
Install using "go get":
go get github.com/srfrog/slices
Then import from your source:
import "github.com/srfrog/slices"
View example_test.go for examples of basic usage and features.
Documentation
The full code documentation is located at GoDoc:
http://godoc.org/github.com/srfrog/slices
Usage
This is a en example showing basic usage.
package main
import(
"fmt"
"github.com/srfrog/slices"
)
func main() {
str := `Don't communicate by sharing memory - share memory by communicating`
// Split string by spaces into a slice.
slc := strings.Split(str, " ")
// Count the number of "memory" strings in slc.
memories := slices.Count(slc, "memory")
fmt.Println("Memories:", memories)
// Split slice into two parts.
parts := slices.Split(slc, "-")
fmt.Println("Split:", parts, len(parts))
// Compare second parts slice with original slc.
diff := slices.Diff(slc, parts[1])
fmt.Println("Diff:", diff)
// Chunk the slice
chunks := slices.Chunk(parts[0], 1)
fmt.Println("Chunk:", chunks)
// Merge the parts
merge := slices.Merge(chunks...)
fmt.Println("Merge:", merge)
}