-
Notifications
You must be signed in to change notification settings - Fork 48
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-gofast generates different names #25
Comments
Ok so letmegrpc does not call the CamelCase function. The easiest fix though is just to change you message name to match the camel cased name. |
I went back to proto-gen-go, and read & implemented the Protocol Buffers Style Guide (CamelCase for message and service names, snake_case for field names), and now letmegrpc starts flawlessly, it's only complaint is a missing GZIPDecompressor - I'll try to add that. But very possible that the error is not in letmegrpc, but protoc-gen-gofast (gogoprotobuf), as it handled non-CamelCase names very inconsistently... |
protoc-gen-gofast should generate almost exactly the same code protoc-gen-go |
I haven't said that protoc-gen-go produced different code, just that I went back to it to get as close to a working example as I can. I've included the generated .pb.go in db_dealer.zip in the first comment - for example, db_dealer__utolso_mod becomes "/db_dealer.db_dealer__utolso_mod/DbDealer_UtolsoMod" in its Handler's UnaryServerInfo, but in the Client, Invoke calls "/db_dealer.db_dealer__utolso_mod/db_dealer__utolso_mod", which does not match... As I'm generating the .proto file, the change to use CamelCase is not a problem. |
How did you go back to get as close to a working example as possible? |
Now I created a minimal example .proto file, and you're right, gofast and go both create the same naming inconsistencies: Client Invokes "/db_dealer.db_dealer/db_dealer__utolso_mod", but Handler uses "/db_dealer.db_dealer/DbDealer_UtolsoMod" in UnaryServerInfo.FullMethod. |
Ok so now that you've contributed do you think you are ready to fix this as well? |
Aye aye, Sir! Walter Schulze notifications@github.com ezt írta (időpont: 2016. szept.
|
I think this fix should happen in letmegrpc and not in gogoprotobuf. |
But that inconsistency is in gogoprotobuf's gprc code generator! |
This code is consistently being generated in the same way by go_out, gofast_out and gogo_out |
db_dealer.zip
protoc-gen-gofast generates DbDealer_UtolsoMod from the proto name db_dealer__utolso_mod.
The protoc-gen-letmegrpc plugin uses the names from the proto unchanged. I've tried to replicate what gofast does (vanity and vanity/command) but seems a little bit magic, and when it worked, it did not compile, missed the "Serve" function from the html plugin.
Please help me sort this out!
The text was updated successfully, but these errors were encountered: