grpc-ecosystem / grpc-gateway

gRPC to JSON proxy generator following the gRPC HTTP spec
https://grpc-ecosystem.github.io/grpc-gateway/
BSD 3-Clause "New" or "Revised" License
18.11k stars 2.23k forks source link

grpc-ecosystem/grpc-gateway/third_party/googleapis: warning: directory does not exist. #1068

Closed vctqs1 closed 4 years ago

vctqs1 commented 4 years ago

ENV: MacOS

protoc -I/usr/local/include -I. \ -I$GOPATH/src \ -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ --go_out=plugins=grpc:pkg/api \ api/*.proto

ERROR:
oogle/api/annotations.proto: File not found. product.proto: Import "google/api/annotations.proto" was not found or had errors. /Users/macbookpro/Go/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis: warning: directory does not exist. google/api/annotations.proto: File not found.

johanbrandhorst commented 4 years ago

https://github.com/grpc-ecosystem/grpc-gateway/issues/1065#issuecomment-544241612

vctqs1 commented 4 years ago

# 1065 (bình luận)

Can you give me example for this situation?. I'm new member.

johanbrandhorst commented 4 years ago

@vctqs1 I gave you a short answer because you ignored the helpful instructions in the issue template which ask you to come to the Gophers slack and ask for help if you're having problems getting started. This issue tracker is not useful for this kind of debugging and assistance.

In this case, maybe try starting with https://github.com/johanbrandhorst/grpc-gateway-boilerplate which has everything set up for you. If you still need help, join the gophers slack.

vctqs1 commented 4 years ago

@vctqs1 I gave you a short answer because you ignored the helpful instructions in the issue template which ask you to come to the Gophers slack and ask for help if you're having problems getting started. This issue tracker is not useful for this kind of debugging and assistance.

In this case, maybe try starting with https://github.com/johanbrandhorst/grpc-gateway-boilerplate which has everything set up for you. If you still need help, join the gophers slack.

I installed it according to the instructions but this is still not effective go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golang/protobuf/protoc-gen-go

aviddiviner commented 4 years ago

I was able to resolve this by doing: -I=$GOPATH/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.12.1/third_party/googleapis

That version number will change depending on what you have installed.