-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update go_package declarations #1593
Conversation
@@ -15,7 +15,7 @@ | |||
syntax = "proto3"; | |||
|
|||
package grpc.lb.v1; | |||
option go_package = "messages"; | |||
option go_package = "google.golang.org/grpc/grpclb/grpc_lb_v1/messages"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this option also changes the output file path. (Run make proto
to see the result).
It seems our current proto structure (or just the way we run protoc
) doesn't work well with this new go_package
. We need to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix for this is to change the --go_out
parameter for go generate
in grpclb_test.go
diff --git a/grpclb/grpclb_test.go b/grpclb/grpclb_test.go
index 46c1fe5..cc8d75c 100644
--- a/grpclb/grpclb_test.go
+++ b/grpclb/grpclb_test.go
@@ -16,8 +16,8 @@
*
*/
-//go:generate protoc --go_out=plugins=:. grpc_lb_v1/messages/messages.proto
-//go:generate protoc --go_out=Mgrpc_lb_v1/messages/messages.proto=google.golang.org/grpc/grpclb/grpc_lb_v1/messages,plugins=grpc:. grpc_lb_v1/service/service.proto
+//go:generate protoc --go_out=plugins=:$GOPATH grpc_lb_v1/messages/messages.proto
+//go:generate protoc --go_out=plugins=grpc:$GOPATH grpc_lb_v1/service/service.proto
// Package grpclb_test is currently used only for grpclb testing.
package grpclb_test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The expected contents of
go_package
has changed, see golang/protobuf#139This is needed to build stuff with bazel - see bazelbuild/rules_go#836