mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
89250dbfdd
* add support for the json:",omitzero" tag
omitzero was added to the go stdlib encoder/json in go 1.24
* add case which omitempty missed: uintptr is encodable in json
and does accept omitempty in the go stdlib encoder/json.
* add omitzero test cases for pointer-to-"" and pointer-to-{}
(both should marshal to something in order to match stdlib json, and
they do)
* fix and add tests for the case when omitzero is combined with omitempty
Without a special case the generated code can look like
if v != nil && v != nil {
or
if v != "" && v != "" {
and that gets flagged by go vet (go 1.25.5)