回答

1

我不明白這是grpc-gateway的一部分。通過following the docs我跑

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:. *.proto 

並編譯成功。

1

默認情況下不包含empty.proto和annotation.proto,因此您需要提供一份副本。具體而言,您可以在項目目錄中複製它們,或者在現有項目中引用它們(例如Protobuf git repo)。

這可能是一個好主意不是參考grpc-ecosystem/grpc-gateway使用的副本,因爲他們可能想在將來移動它。