[已解决!]Import "google/protobuf/descriptor.proto" was not found or had errors.

解决步骤:
1:先在IDE访问google/protobuf/descriptor.proto将其copy
2:创建类似结构

-gopath
      -src
          -google
                  -protobuf
                        -descriptor.proto

3.将copy的文件赋值到descriptor.proto中(或不需要创建直接下载 https://github.com/protocolbuffers/protobuf 将src/goole文件夹直接移动到GOPATH/src下)
4.执行shell命令生成.proto文件
$ protoc --go_out=plugins=grpc:. -I=${GOPATH}/src -I=. *.proto

亲测有效 适用于MAC

Songzhibin
原文地址:https://www.cnblogs.com/binHome/p/13061407.html