Mirrors golang/go
Drop-in replacement for Golang encoding/json
with additional features.
$ go get -u github.com/clarketm/json
- import "encoding/json"
+ import "github.com/clarketm/json"
Same usage as Golang encoding/json
.
- Support zero values of structs with
omitempty
: golang/go#11939.
If
omitempty
is applied to a struct and all the children of the struct are empty, then on marshalling it will be omitted from the encoded json.
name old time/op new time/op delta
EncodeMarshaler-16 45.1ns ± 9% 46.1ns ±10% ~ (p=0.224 n=20+20)
name old alloc/op new alloc/op delta
EncodeMarshaler-16 4.00B ± 0% 4.00B ± 0% ~ (all equal)
name old allocs/op new allocs/op delta
EncodeMarshaler-16 1.00 ± 0% 1.00 ± 0% ~ (all equal)
Refer to the Golang license. See LICENSE for more information.