-
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
protobuf3 support for "Any" #60
Comments
An example: from a .proto:
I would put an HttpCheck object in the CheckSpec field on a TestCheckRequest message. Unmarshaling this has proven difficult. |
You can use |
Yeah. I'm just not going to use Any. |
I figured it out, for posterity's sake: We're going with a combination of a type switch and:
This could be made more elegant, but it works for now. |
For folks like me coming to this from gooling around, there's now helper functions at ptypes.MarshalAny and ptypes.UnmarshalAny |
Is there an idiomatic way to support Any's in messages in Go? I have been struggling with reflect for a couple of days, and I think if I'm having this much trouble, I must be doing it wrong.
The text was updated successfully, but these errors were encountered: