Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
protoc-gen-go: XXX_ fields break code back compatibility #607
This breaks an existent code.
Another argument to the issue #276
Even if the
This breakage is really unfortunate, but it's a consequence of Go protobufs being compliant with the updated proto3 specification. See #594 (comment).
This is orthogonal to #276, which is about removing XXX fields from the exported API. The implementation will still require unexported fields of some form, some of which may still be incomparable.
@dsnet Then I would say that an update to the proto3 spec broke it.
First (many moons ago) when proto2 was introduced, Optional Fields were all the rage and unrecognized fields just sit quietly in reserved by them "slots". Then proto3 came in, and put it as "optional is no more - everything is optional" (and broke separation of "not supplied" and "default" by the way). Now, by introducing XXX_ mess it pretty much went back, just storing unrecognized fields under XXX_. Again, breaking perfectly normal code that was comparing proto.Timestamp, and other simple generated structs.
proto generated code in the current form is unusable for anything but storage - with no comparison, simple, small, and fast common structures used between different components neither not small nor fast anymore.