安装
$ go get -u google.golang.org/grpc
获取 goprotobuf 提供的 Protobuf 编译器插件 protoc-gen-go
$ go get github.com/golang/protobuf/protoc-gen-go
一般安装在$GOBIN
Build the example
$ cd $GOPATH/src/google.golang.org/grpc/examples/helloworld
gRPC服务在.proto文件中定义,该文件用于生成相应的.pb.go文件。 .pb.go文件是通过使用协议编译器编译.proto文件生成的:protoc。