Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clarketm/json
Drop-in replacement for Golang encoding/json with additional features.
https://github.com/clarketm/json
encoder-decoder golang json
Last synced: about 1 month ago
JSON representation
Drop-in replacement for Golang encoding/json with additional features.
- Host: GitHub
- URL: https://github.com/clarketm/json
- Owner: clarketm
- License: bsd-3-clause
- Created: 2019-08-10T04:59:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-12T03:01:39.000Z (over 2 years ago)
- Last Synced: 2024-12-11T03:11:58.365Z (about 2 months ago)
- Topics: encoder-decoder, golang, json
- Language: Go
- Homepage: https://godoc.org/github.com/clarketm/json
- Size: 146 MB
- Stars: 53
- Watchers: 4
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [json](https://godoc.org/github.com/clarketm/json)
> Mirrors [golang/go](https://github.com/golang/go) [![Golang version](https://img.shields.io/badge/go-1.15-green)](https://github.com/golang/go/releases/tag/go1.15)Drop-in replacement for Golang [`encoding/json`](https://golang.org/pkg/encoding/json/) with additional features.
## Installation
```shell
$ go get -u github.com/clarketm/json
```## Usage
```diff
- import "encoding/json"
+ import "github.com/clarketm/json"
```
Same usage as Golang [`encoding/json`](https://golang.org/pkg/encoding/json/).## Features
- Support zero values of structs with `omitempty`: [golang/go#11939](https://github.com/golang/go/issues/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.## [Benchmarks](bench.txt)
```text
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)
```## License
Refer to the [Golang](https://github.com/golang/go/blob/master/LICENSE) license. See [LICENSE](LICENSE) for more information.