Skip to content
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

There is no check for reserved words in Golang #2

Open
andrey308 opened this issue Jun 7, 2022 · 2 comments · May be fixed by #74
Open

There is no check for reserved words in Golang #2

andrey308 opened this issue Jun 7, 2022 · 2 comments · May be fixed by #74

Comments

@andrey308
Copy link

For example if you will try to generate field mask from such proto file:

syntax = "proto3";

option go_package = "unparsable";

package unparsable;

message Foo {
  string type = 1;
  string switch = 2;
}

You will get an error:
--fieldmask_out: t.pb.fieldmask.go: unparsable Go source: 41:64: expected selector or type assertion, found 'type' (and 4 more errors)

So the problem is that if you use as a field name reserved word in Goland - it will be an error.

@idodod
Copy link
Owner

idodod commented Jun 8, 2022

Hi @andrey308 ,
Thanks raising this issue, I will look into it.

andrey308 pushed a commit to andrey308/protoc-gen-fieldmask that referenced this issue Jun 13, 2022
@andrey308
Copy link
Author

fixed in my repo - https://github.com/andrey308/protoc-gen-fieldmask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants