protobuf 文件 里面 引用了 谷歌的時間戳 import "google/protobuf/timestamp.proto"
makefile 文件
這樣看沒什么問題…… 然后 執行 make grpc-go
結果報這個錯……
$ make grpc-go | xsel -ib
google/protobuf/timestamp.proto: File not found.
user.proto:6:1: Import "google/protobuf/timestamp.proto" was not found or had errors.
user.proto:14:3: "google.protobuf.Timestamp" is not defined.
user.proto:15:3: "google.protobuf.Timestamp" is not defined.
make: *** [Makefile:15:grpc-go] 錯誤 1
說谷歌 的 timestamp.proto 沒找到 , 百度了 半天 沒有結果
后來 想看看 protoc 是哪個 輸入 了 whereis protoc
$ whereis protoc
protoc: /usr/bin/protoc /home/ifnk/go/bin/protoc
竟然有兩個路徑 ……
寫全路徑 試試
還是報錯
換 /ust/bin/protoc 的 試試
成功 了 ,不報錯 了 ,下次 makefile 調用 程序的時候 報錯 , 試試看 寫 程序的完整路徑