Ubuntu20.04安装gRPC-go

Ubuntu20.04安装gRPC-go

安装gRPC-go前你需要安装go和protobuf

第一步

根据前辈们经验

#实测发现直接下载源码包,无法编译。所以采用git方式。
git clone https://github.com/grpc/grpc.git

#切换文件夹
cd grpc

#更新第三方源码
git submodule update --init

第二步

#直接git,不用先配置环境。
git clone -b v1.30.0 https://github.com/grpc/grpc-go

#启动server,这事如果没有配置环境的话,系统会先下环境依赖再运行 
$ cd grpc-go/examples/helloworld/greeter_server
$ go run main.go 

#启动client
$cd grpc-go/examples/helloworld/greeter_client
$ go run main.go 

结果

请添加图片描述