3 ms·
For others following along - this is https://github.com/golang/go/issues/5901 https://github.com/golang/go/issues/5901 to register custom marshallers on an exis
by mappu 7y ago
For others following along - this is https://github.com/golang/go/issues/5901 https://github.com/golang/go/issues/5901 to register custom marshallers on an existing `json.Encoder` instance.
I feel like it's generally possible to work around this by creating a wrapper struct with an overridden MarshalJSON method? But maybe that's infeasible for deeply nested structs.
- jpdb 7y ago> But maybe that's infeasible for deeply nested structs. That's the crux of my issue. If it was only for a single, un-nested field then it would be trivial. I am currently solving it by walking through the whole struct, but that is not-ideal.