ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.87k stars 295 forks source link

Bug in encoding struct #72

Closed fgrzadkowski closed 9 years ago

fgrzadkowski commented 9 years ago

For a struct:

type ContainerState struct {
    Waiting     *ContainerStateWaiting    `json:"waiting,omitempty"`
    Running     *ContainerStateRunning    `json:"running,omitempty"`
    Termination *ContainerStateTerminated `json:"termination,omitempty"`
}

which has only running defined (waiting and termination are nulls) json generated by generated code looks like this:

                "state": {
                    ,
                    "running": {
                        "startedAt": "2015-04-22T13:49:32+02:00"
                    }
                },