proto编译引用外部包问题
proto编译引用外部包问题在test.proto文件中引用了一个外部包: 1import "google/api/annotations.proto"; 当使用命令编译的时候提示找不到包: 123# protoc --go_out=plugins=grpc:. ./test.protogoogle/api/annotations.proto: File not found.test.proto:5:1: Import "google/api/annotations.proto" was not found or had errors. 解决去github上将对应的包下载下来放在$GOPATH/src下,例如这里缺失google/api。 去gooogleapis将项目下载下来,并将整个项目放到$GOPATH/src,此时的完整路径应该是: 1$GOPATH/src/google/api/annotations.proto 这才完成了第一步,如果这时候去直接执行protoc编译命令,依旧会得到上面的报错信息,protoc并没有成功的获...
