Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proto: treat bad wire types as unknown fields (#511)
Previously, an error was returned during unmarshal when a wiretype was encountered that did not match the expected wiretype. In order to match the behavior of the C++ and Python implementations, we no longer return an error and instead store the bad wire fragment as an unknown field (or skip them if unknown field preservation is disabled). The generator still produces code that references ErrInternalBadWireType for unmarshal logic for oneof fields. However, the current proto package does not use the generated unmarshalers for oneofs, so their existence has no bearing on unmarshal semantics. Cleaning up the generator to stop producing these is future work.
- Loading branch information