-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protoc-gen-go: XXX_ fields break code back compatibility #607
Comments
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. |
Just to add more on what these changes broke.
|
@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. |
Please see my comment here (#594 (comment)). |
Necessary due to updates in github.com/golang/protobuf. See golang/protobuf#607
Necessary due to updates in github.com/golang/protobuf. See golang/protobuf#607
Necessary due to updates in github.com/golang/protobuf. See golang/protobuf#607
Necessary due to updates in github.com/golang/protobuf. See golang/protobuf#607
having
[]byte
XXX_ fields in generated code prevents those structs to be able to be compared by value.This breaks an existent code.
Another argument to the issue #276
Even if the
[]byte
field will be removed, those third-party states being embed into the structs makes it pointless.The text was updated successfully, but these errors were encountered: