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 'options go_package' #11

Open
idlebot opened this issue Jul 18, 2023 · 0 comments
Open

Support for 'options go_package' #11

idlebot opened this issue Jul 18, 2023 · 0 comments

Comments

@idlebot
Copy link

idlebot commented Jul 18, 2023

go_proto_link currently copies the .pb.go files to the same directory as the .proto file.

However, if the .proto file has a options go_package defined, it does not copy to directory specified in the go_options.

For example, given a file:

proto/mypackage/v1/test.proto

package mypackage.v1;

option go_package = "github.com/org/repo/go/mypackage/v1;mypackagev1";

Ideally, it would copy test.pb.go to go/mypackage/v1 instead of proto/mypackage/v1.

One way that this could be accomplished would be by:

  • define a importpath attribute in the go_proto_link rule just like go_proto_library.
  • Gazelle plugin copies the importpath from go_proto_library
  • go_proto_link rule uses the relevant part of importpath to copy to the correct destination directory, creating the path if needed.
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