* 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)
When large amounts of data are unmarshaled for immediate non long live use than
copying of strings from original buffer can be avoided and instead a
reference to the original buffer returned in the field value.
Note, if the value requires unescaping, than it will be processed as
normally done with copying.
Signed-off-by: Kirill Korotaev <kirillx@gmail.com>
by assuming the caller knows what they are doing and that the custom
marshler will generate JSON appropriate for a key.
The standard library's encoding/json supports these.