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

Run demo failed! #1777

Closed
AP0rPi7uQ9 opened this issue Oct 28, 2020 · 1 comment
Closed

Run demo failed! #1777

AP0rPi7uQ9 opened this issue Oct 28, 2020 · 1 comment

Comments

@AP0rPi7uQ9
Copy link

Directory Structure:

test
|--test.proto
|--google (This directory is copied from /github.com/grpc-ecosystem/grpc-gateway/[email protected]/third_party/googleapis/google)
|--gen
|----go

test.proto

 syntax = "proto3";
 package your.service.v1;
 option go_package = "github.com/yourorg/yourprotos/gen/go/your/service/v1";
 import "google/api/annotations.proto";
 message StringMessage {
   string value = 1;
 }

 service YourService {
   rpc Echo(StringMessage) returns (StringMessage) {
    option (google.api.http) = {
        post: "/v1/example/echo"
        body: "*"
    };
   }
 }

When I run 【protoc -I . --grpc-gateway_out ./gen/go --grpc-gateway_opt logtostderr=true --grpc-gateway_opt paths=sourc
e_relative test.proto】, it is the same as the command in demo.

I failed and got an error message

> C:\Users\User\go\src\grpc\test>protoc -I . --grpc-gateway_out ./gen/go --grpc-gateway_opt logtostderr=true --grpc-gateway_opt paths=sourc
e_relative test.proto
google/protobuf/descriptor.proto: File not found.
google/api/annotations.proto:20:1: Import "google/protobuf/descriptor.proto" was not found or had errors.
google/api/annotations.proto:28:8: "google.protobuf.MethodOptions" is not defined.
test.proto:4:2: Import "google/api/annotations.proto" was not found or had errors.
@johanbrandhorst
Copy link
Collaborator

Hm, that should work, but this isn't really the right place for this sort of debugging, could you join our Slack channel (#grpc-gateway) on Gophers slack and I can help figure out what the problem is?

Closing as this is an environment issue.

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