grpc 安装以及墙的解决方法

1. 默认官方文档
go get -u google.golang.org/grpc
因墙的问题,大部分安装是无法完成的
2. 解决方法
a. grpc
mkdir -p $GOAPTH/src/google.golang.org
git clone https://github.com/grpc/grpc-go.git
mv grpc-go grpc
b. genproto
mkdir -p $GOAPTH/src/google.golang.org
git clone https://github.com/google/go-genproto.git
mv go-genproto genproto
3. 运行例子
cd $GOAPTH/src/google.golang.org/grpc/examples/helloworld

cd greeter_server 
go run main.go
cd greeter_client
go run main.go
4. 参考资料
https://github.com/google/go-genproto
https://github.com/grpc/grpc-go
https://grpc.io/docs/quickstart/go.html#update-the-server

posted on 2018-02-27 20:31  荣锋亮  阅读(541)  评论(0编辑  收藏  举报

导航