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

httpbody.proto has incorrect go_package #1263

Closed
ideasculptor opened this issue Apr 30, 2020 · 1 comment
Closed

httpbody.proto has incorrect go_package #1263

ideasculptor opened this issue Apr 30, 2020 · 1 comment

Comments

@ideasculptor
Copy link

ideasculptor commented Apr 30, 2020

Steps you follow to reproduce the error:

  1. When NOT using protobuf APIv2, I can't rely on the google.golang.org/genproto package for the protoc-compiled version of the annotations.proto, http.proto, and httpbody.proto files. Since I'm using grpc, I'm forced to APIv1 for now, which means I need to compile them myself.
  2. protoc --proto_path . --go_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor:. google/api/*.proto
  3. When I compile against the generated files, I get an error from Go that there is more than one package in the same directory.
  4. This is totally consistent with the Buf style guide, which also suggests all .proto files in the same directory should have the same go_package.

Simple fix is to adjust the go_package line in httpbody.proto to match the go_package of the other two protos in google/api

@johanbrandhorst
Copy link
Collaborator

Hi, thanks for your issue. You should be able to depend on an older version of google.golang.org/genproto and not have to generate files from our third_party package. We don't intend to support this use case. I personally use the grpc-gateway with APIv1 and never had to generate from these files, they're only there so that your proto imports can be resolved.

In any case, we can't change the package of httpbody.proto, since it's sourced from https://github.com/googleapis/googleapis/blob/master/google/api/httpbody.proto.

Why don't you join the #grpc-gateway channel on Gophers slack and we can debug this there. This is not the right forum for it.

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