vtprotobuf
vtprotobuf copied to clipboard
Call Reset before UnmarshallVT to keep the default grpc semantic
Fixes #128
Contrary to what was discussed in the issue, I was not able to call ResetVT() before UnmarshallVT() because the reset method isn't always generated (it's only generated when the pool option is enabled)
Perhaps the ResetVT() method should also be generated when the unmarshal feature is enabled ?
You should do the same trick as the code does to detect the MarshalVT method - use an interface that declares ResetVT and see if the type implements that interface. That way you don't have to depend on protobuf.
In addition to @bhollis's comment I'd suggest to extract ResetVT generation from pool under a new option reset.