-
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
Remove references to RawMessage #311
Comments
It's an internal thing. It is supposed to allow for certain functions (e.g. proxy servers) to work with serialized protocol messages directly without the overhead of marshaling and unmarshaling. I agree that the interface we use to detect it is awkwardly broad. |
(We can't remove it, but perhaps we can make it less prone to collisions.) |
Does it need to stay an interface? I could imagine replacing |
It has to correspond to some exported concrete type somewhere, or else nobody can use it. It might make sense to promote to a concrete type into the |
Yeah, I meant |
The proposed change would need a bit of a complicated internal migration. Unfortunately, I don't think this will work as a PR (sorry!). |
No problem. What can I do to help? |
Hello. Now that |
I'm out-of-office for 2 weeks. I'm not going to think about this till I get back. |
Support @bcmills, do you forsee any issues with that? |
None that I can immediately think of. |
Alright, I'll work on making the appropriate changes internally and push it to |
There is an internal type to Google called RawMessage that is similar to json.RawMessage. Since there is no proper proto reflection API, we special-cased the Bytes method of RawMessage to access the raw bytes. This is a gross hack since Bytes() []byte is such a common method signature. Remove this hack. Fixes #311
There is an internal type to Google called RawMessage that is similar to json.RawMessage. Since there is no proper proto reflection API, we special-cased the Bytes method of RawMessage to access the raw bytes. This is a gross hack since Bytes() []byte is such a common method signature. Remove this hack. Fixes #311
(this issue has remained open because #482 was merged to |
Closing this as the merge work will be tracked in #479. |
The code contains a few references to this type, including
type raw interface { Bytes() []byte }
which is supposed to be implemented byRawMessage
. Unfortunately, that method signature is not as uncommon as one would hope, which can cause bad interactions when that function is implemented on generated structs or their constituent fields (e.g. via github.com/gogo/protobuf'scustomtype
option).My question is: is RawMessage still a thing? If yes, what is it? If no, would you accept a PR removing "support" for it?
cc @dsymonds
The text was updated successfully, but these errors were encountered: