0

I have been following a gRPC tutorial, this works perfectly fine. The problems start when I try to add https://github.com/grpc-ecosystem/grpc-gateway to my project. I use the commands they give you:

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

and I import the package in my proto:

import "google/api/annotations.proto";

I am getting an error on the line above saying "file not found". When I copy the files inside my project, they are found but when I run the command

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:. \
  path/to/your_service.proto

it will complain that it cannot find the files.

Could someone please tell me the correct way on how to be able to get this grpc-gateway working properly?

I am currently on windows with GoLand as IDE.

4

1 回答 1

0

如果我正确阅读了此问题,则与您的情况相同。他们说你必须把这些文件放在你的存储库中https://github.com/grpc-ecosystem/grpc-gateway/issues/1065#issuecomment-544241612

于 2019-12-08T18:40:58.063 回答