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
结果


本文详细介绍了在Ubuntu20.04上安装gRPC-go的步骤,包括先决条件:安装Go和Protobuf。遵循文中两步操作指南,即可成功完成gRPC-go的安装。
最低0.47元/天 解锁文章
737

被折叠的 条评论
为什么被折叠?



