Skip to content

protoc-gen-go: regression in handling of source_relative parameter #1076

Closed
@kevinburke1

Description

@kevinburke1

I am attempting to generate a Go pb.go file. This is the command I am running to generate it with the old binary:

cd pb && protoc --ruby_out=source_relative:../ruby/pb --go_out=source_relative:/Users/kevin/src api.proto

I run that command from $GOPATH/src/github.com/myorg/myproject. It writes a file to $GOPATH/src/github.com/myorg/myproject/pb/api.pb.go.

With the new cmd/protoc-gen-go, I get the following error:

cd pb && protoc --ruby_out=source_relative:../ruby/pb --go_out=source_relative:/Users/kevin/src api.proto
protoc-gen-go: no such flag -source_relative
--go_out: protoc-gen-go: Plugin failed with status code 1.
make: *** [Makefile:13: pb/api.pb.go] Error 1

Confusingly, I can see references to source_relative in the source code, but the references in the README of the new project have disappeared.

I can get it to generate a file by changing the command to read:

cd pb && protoc --ruby_out=source_relative:../ruby/pb --go_out=paths=source_relative:/Users/kevin/src api.proto

However, this writes api.pb.go to $GOPATH/src/api.pb.go, not $GOPATH/src/github.com/myorg/myproject/pb/api.pb.go as I expect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions