News for hackers. Stuff that matters.
Re:Go 1.14 release notes by jpdb on Tuesday February 25, 2020 @07:07PM (#22418938)
Wish the json.Register funcion had been in 1.14. Desperately need it for a project I'm working on. If anyone has any ideas for overriding structs in a pkg I'd love to hear them!
Re:Go 1.14 release notes by mappu on Wednesday February 26, 2020 @12:05AM (#22420435)
For others following along - this is 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.

Re:Go 1.14 release notes by jpdb on Wednesday February 26, 2020 @09:45AM (#22423313)
> 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.