as / json

fork of encoding/json that fixes omitempty behavior on structs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json

A fork of encoding/json that fixes omitempty behavior on structs

https://play.golang.org/p/M8AOBJgWMJy

Example

T := struct {
	B struct {} `json:",omitempty"`
}{}

json.NewEncoder(os.Stdout).Encode(T) // stdlib
NewEncoder(os.Stdout).Encode(T) // this package

Output

{"B":{}} // stdlib
{} // this package

About

fork of encoding/json that fixes omitempty behavior on structs

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%