The "omitzero" JSON tag has been introduced in Go 1.24. However, the easyjson generated functions completely ignore it.
For example this test succeeds without easyjson
type S struct {
N int `json:"n,omitzero"`
}
func TestEasyjsonOmitZero(t *testing.T) {
s := S{N: 0}
b, err := json.Marshal(s)
require.NoError(t, err)
assert.Equal(t, "{}", string(b))
}
But if we generated JSON marshallers for S, it fails
Error: Not equal:
expected: "{}"
actual : "{\"n\":0}"
The "omitzero" JSON tag has been introduced in Go 1.24. However, the easyjson generated functions completely ignore it.
For example this test succeeds without easyjson
But if we generated JSON marshallers for
S, it fails