Proposal Details
One issue that we faced in the old Go JSON implementation is the inability to remove a field entirely when marshalling to JSON (when implementing the MarshalJSON func).
This feature is still not possible in the json/v2 implementation. While it is possible to set the exported field value to JSON null, removing the field completely does not seem possible.
Is there anything I am missing or there is currently no way to achieve this?
Previously, there was a proposal to return a SkipFieldErr error from the MarshalJSON which the encoder would interpret as to remove the field from the generated json.
Proposal Details
One issue that we faced in the old Go JSON implementation is the inability to remove a field entirely when marshalling to JSON (when implementing the MarshalJSON func).
This feature is still not possible in the json/v2 implementation. While it is possible to set the exported field value to JSON null, removing the field completely does not seem possible.
Is there anything I am missing or there is currently no way to achieve this?
Previously, there was a proposal to return a SkipFieldErr error from the MarshalJSON which the encoder would interpret as to remove the field from the generated json.