grpc,protobuf安装
grpc
http://www.topgoer.com/%E5%BE%AE%E6%9C%8D%E5%8A%A1/gRPC/
安装
go get github.com/golang/protobuf/proto
go get google.golang.org/grpc(无法使用,用如下命令代替)
git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net
git clone https://github.com/golang/text.git $GOPATH/src/golang.org/x/text
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
git clone https://github.com/google/go-genproto.git $GOPATH/src/google.golang.org/genproto
cd $GOPATH/src/
go install google.golang.org/grpc
protobuf安装
go get github.com/golang/protobuf/protoc-gen-go
上面安装好后,会在GOPATH/bin下生成protoc-gen-go.exe
但还需要一个protoc.exe,windows平台编译受限,很难自己手动编译,直接去网站下载一个,地址:https://github.com/protocolbuffers/protobuf/releases/tag/v3.9.0 ,同样放在GOPATH/bin下
proto3语法官网
https://developers.google.com/protocol-buffers/docs/proto3
proto3语法生成文件
proto文件:option go_package = "../services";
protoc --go_out=plugins=grpc:../services Prod.proto
选择了IT,必定终身学习