We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
option (go.lint).all = true;
Firstly, thanks a lot for this project, it's really great.
Provided awesome/v1/entity.proto:
awesome/v1/entity.proto
package awesome.v1; import "patch/go.proto"; option (go.lint).all = true; enum MyEnum { MY_ENUM_UNSPECIFIED = 0; }
It generates idiomatic Go identifiers 👍 on entity.pb.go:
entity.pb.go
const ( MyEnumUnspecified MyEnum = 0 )
And then awesome/api/v1/api.proto:
awesome/api/v1/api.proto
package awesome.api.v1; import "patch/go.proto"; import "awesome/v1/entity.proto" option (go.lint).all = true; message MessageWithMyEnum { awesome.v1.MyEnum my_enum = 0; }
But at generate this message, it fails to use the patched identifier on api.pb.go:
api.pb.go
func (x *MessageWithMyEnum) GetMyEnum() v1.MyEnum { if x != nil { return x.MyEnum } return v1.MY_ENUM_UNSPECIFIED }
This is worked around with this code:
enum MyEnum { MY_ENUM_UNSPECIFIED = 0 [(go.value) = {name:'MyEnumUnspecified'}]; }
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, thanks for the bug report. That’s…interesting. I’ll take a look.
Sorry, something went wrong.
tests/lint: add test for imported enum value
0a69ffd
This is a test case to verify the bug in #40.
patch: remove optimization for renamed enum values
477da08
This fixes using imported enum values renamed with (go.lint).all. Fixes #40.
CHANGELOG: add note about #40
8f2b8f4
fa21e5e
ydnar
Successfully merging a pull request may close this issue.
Firstly, thanks a lot for this project, it's really great.
Provided
awesome/v1/entity.proto
:It generates idiomatic Go identifiers 👍 on
entity.pb.go
:And then
awesome/api/v1/api.proto
:But at generate this message, it fails to use the patched identifier on
api.pb.go
:This is worked around with this code:
Thanks!
The text was updated successfully, but these errors were encountered: