Skip to content

Support for source_relative argument #1180

Closed
@octo47

Description

@octo47

We are using source_relative for go_out plugin.
Effect of this use is that generated go files put in same directory as .proto file.
Unfortunately grpc-gateway generator has not such option and so it generates files using full go_package.

For example file echo.proto sitting in /protocol/echo:

package echo;
option go_package = "github.com/mycorp/repo.git/protocol/echo";

go_out supports generation of source_relative which means .go files will be put along in a same directory /protocol/echo.
This is not the case for grpc-gateway generator, files are put into /protocol/github.com/mycorp/repo.git/protocol/echo

Would be nice to support same source_relative argument as go generator does.

Previously workaround was to use simple package names like go_package="echo", but now as per 1.4rc it is deprecated feature and will be not supported soon.

2020/03/20 10:56:59 WARNING: Deprecated use of 'go_package' option without a full import path in "echo/echo_service.proto", please specify:
	option go_package = "echo";
A future release of protoc-gen-go will require the import path be specified.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.

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