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

[BUG] Variable name conflict if that both exists two fields named id and getId #774

Open
cupen opened this issue May 13, 2024 · 0 comments

Comments

@cupen
Copy link

cupen commented May 13, 2024

NOTE: I know gogo/protobuf is deprecated. Just notes here for someone meeting this problem.

Version: v1.3.2

Here is the protobuf defines.

syntax = "proto3";
package pb;
option go_package = "./pb";

message Hello {
    int32 id = 1;
    int32 getId = 2;
}

And here is the compile commands for reproduce it.

# install
go install github.com/gogo/protobuf/[email protected]
go install github.com/gogo/protobuf/[email protected]

# compile
protoc -I . --go-gogoslick_out=.  ./test.proto

# or
protoc -I . --go-gogofast_out=.  ./test.proto

It may casing a syntax error that both exists a variable named GetId and a function named GetId.

@cupen cupen changed the title Variable name conflict: cannot convert m.GetId (value of type func() int32) [BUG] Variable name conflict if that both exists two fields named id and getId May 13, 2024
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

No branches or pull requests

1 participant