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

Support for source_relative argument #1180

Closed
octo47 opened this issue Mar 20, 2020 · 3 comments
Closed

Support for source_relative argument #1180

octo47 opened this issue Mar 20, 2020 · 3 comments

Comments

@octo47
Copy link
Contributor

octo47 commented Mar 20, 2020

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.
@johanbrandhorst
Copy link
Collaborator

I think we do support the paths=source_relative parameter, have you tried it?

@octo47
Copy link
Contributor Author

octo47 commented Apr 17, 2020

Oh right! Sorry for long response.

@octo47 octo47 closed this as completed Apr 17, 2020
@octo47
Copy link
Contributor Author

octo47 commented Apr 17, 2020

Thank you for pointing this out.

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

2 participants