I am butting heads with Go team's stance on the behavior of the omitempty tag where they treat empty map, slice and arrays as null values. Unfortunately all json encoding libraries parrot this blatant mistreatment of data so I have no choice but to avoid using omitempty tag altogether. This causes messages to be unnecessarily large for storage and transmission since now all fields will be present, no matter their value. To fix this problem I have to sacrifice performance, of better json encoders than the native one, for data cleanup and so I was wondering if it is possible for this library to recursively remove fields with null values from the json message? I've read an issue where you stated one should manipulate only one value at a time so I am wondering if you could maybe write a dedicated cleanup method for this purpose which could be optimized for specific use case of removing multiple values?
I am butting heads with Go team's stance on the behavior of the omitempty tag where they treat empty map, slice and arrays as null values. Unfortunately all json encoding libraries parrot this blatant mistreatment of data so I have no choice but to avoid using omitempty tag altogether. This causes messages to be unnecessarily large for storage and transmission since now all fields will be present, no matter their value. To fix this problem I have to sacrifice performance, of better json encoders than the native one, for data cleanup and so I was wondering if it is possible for this library to recursively remove fields with null values from the json message? I've read an issue where you stated one should manipulate only one value at a time so I am wondering if you could maybe write a dedicated cleanup method for this purpose which could be optimized for specific use case of removing multiple values?