安装ProtoBuff
-
到https://github.com/google/protobuf/releases下载protoc-3.7.1-win64.zip解压,把解压文件夹里的bin目录配置环境变量
Path
,或者把bin目录下的protoc.exe
放入GOPATH
\bin`中测试安装结果
$ protoc --version libprotoc 3.7.1
-
安装Protoc Plugin
go get -u github.com/golang/protobuf/protoc-gen-go
-
安装gRPC
go get -u google.golang.org/grpc
网络原因,替代方案:
git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc