null alternatives and similar packages
Based on the "Data Structures" category.
Alternatively, view null 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. -
gocache
☔️ A complete Go cache library that brings you multiple ways of managing your caches -
boomfilters
Probabilistic data structures for processing continuous, unbounded streams. -
hyperloglog
HyperLogLog with lots of sugar (Sparse, LogLog-Beta bias correction and TailCut space reduction) -
gostl
Data structure and algorithm library for go, designed to provide functions similar to C++ STL -
trie
Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching. -
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] -
hilbert
Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. -
Bloomfilter
Face-meltingly fast, thread-safe, marshalable, unionable, probability- and optimal-size-calculating Bloom filter in go -
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.
Build time-series-based applications quickly and at scale.
Do you think we are missing an alternative of null or a related project?
Popular Comparisons
README
Nullable Go types
Description
This package provides nullable Go types for bool, float64, int64, int32, string and time.Time replacing sql.NullString, sql.NullInt64, ... that can be marshalled/unmarshalled to/from JSON.
Installation
To install "null", run go get within your project:
go get github.com/emvi/null
Note that from 1.3 on "null" requires Go version 1.13 or newer.
Usage
Here is a short example demonstrating the string type. The other types (int64, float64 and bool) work in the same manner.
package main
import (
"encoding/json"
"database/sql"
"fmt"
"github.com/emvi/null"
)
type NullableString struct {
Value null.String `json:"value"`
}
func main() {
str := NullableString{null.NewString("nullable string", true)}
// or long version: str := NullableString{null.String{sql.NullString{String: "nullable string", Valid: true}}}
data, _ := json.Marshal(str)
fmt.Println(string(data)) // -> {"value": "nullable"}
str.SetNil() // use str.SetValid("value") to set a value again
data, _ = json.Marshal(str)
fmt.Println(string(data)) // -> {"value": null}
}
Contribute
[See CONTRIBUTING.md](CONTRIBUTING.md)
License
MIT
*Note that all licence references and agreements mentioned in the null README section above
are relevant to that project's source code only.