gogen-avro
gogen-avro copied to clipboard
how to filter the 'null' in MarshalJSON()?
for example, there is a result for MarshalJSON() function.
{"bucket":{"int":0},"buckets":null,"docid":null}
I want to filter the 'null' in this case.
@Cyberpunk314 You want to encode the record as JSON but you want to omit the empty fields? This library generates structs that serialize to JSON according to the Avro spec, which means the MarshalJSON
method includes null fields.