protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

runtime/protoiface: add Reset fast-path method

Open dsnet opened this issue 5 years ago • 3 comments

Currently the implementation special-cases the Reset method from the v1 Message interface. Should it accomplish this through a protoiface method in the same way as all the other methods like unmarshal and marshal?

dsnet avatar Feb 18 '20 01:02 dsnet

:woman_shrugging: makes sense.

puellanivis avatar Feb 18 '20 09:02 puellanivis

It should, but I don't think this need to block v2. We're going to want to use the Reset method when available anyway, so this is just a question of whether it gets called in the proto or internal/impl package.

(At some point in the future we may have a better approach than calling the Reset method directly, but we'll still need to support Reset for older messages.)

neild avatar Feb 18 '20 17:02 neild

It should, but I don't think this need to block v2.

Agreed.

dsnet avatar Feb 20 '20 04:02 dsnet