Remember when using this code to call proto.Unmarshal. This will call m.Reset and invoke the generated Unmarshal method for you. If you call m.Unmarshal without m.Reset you could be merging protocol buffers.
It’s trying to say you should use
(similar to json/xml unmarshal) to achieve
but I don’t think we do that anywhere really, preferring to cut out the middle man and call the unmarshal method on the type directly instead.
Thanks a lot, that was it!
Maybe I should have, but I definitely didn’t expect this - and it still seems somewhat counterintuitive and misleading to me.
I’ll have a look, but I think we always use Umarshal on a newly created, empty variable - so not a problem in existing code. However I can’t do that with the disk overflow stuff, as I am dealing with interfaces there and thus can’t declare variables - that’s why it’s relevant.