-
Notifications
You must be signed in to change notification settings - Fork 809
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
Using compare plugin does not work for oneof #221
Comments
It also generates invalid tests, but I will raise that as a separate issue |
I think this is the same issue |
The compare plugin was probably not tested with a oneof message |
Ok, I'll skip that issue |
This might also apply to the ProtoSize plugin, should I make a separate issue for that? |
Do you get a compile error, then yes. |
Here is a design for a fix: We have to generated a type switch for each possible one of type for this and that. Anybody up for implementing this? |
Hi,
When using a message which contains a message with a
oneof
variable and using the setting to generate compare methods, the generated interface for the variable does not have the Compare() function generated as part of the interface.Here is a gist which reproduces the error:
https://gist.github.com/johanbrandhorst/783e0908940a2f81d7aef7b1ac93472e
The offending line is my.pb.go:44:
Should be
The text was updated successfully, but these errors were encountered: