Skip to content

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

Description

@cupen

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/protoc-gen-gogoslick@v1.3.2
go install github.com/gogo/protobuf/protoc-gen-gogofast@v1.3.2

# 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions