https://grpc.io/docs/quickstart/go/
export GOPROXY=https://goproxy.cn
echo 'export GOPROXY=https://goproxy.cn' >> ~/.zshrc source ~/.zshrc $ go get -u google.golang.org/grpc $ go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
$ protoc -I my_service --go_out=plugins=grpc:my_service myService.proto
✘ ~/go/src/grpc_go_examples/my_service_server go run main.go Server started... (port=:50051) query=Wall
~/go/src/grpc_go_examples/my_service_client go run main.go [Response] name:"Alice Wall" age:20 country:JAPAN hobby:"tennis" name:"Bobby Wall" age:33 country:CANADA hobby:"music"
已存在的文件夹或 Git 仓库 cd existing_folder git init git remote add origin git@gitee.com:walter80/grpc_go_examples.git git add . git commit git push -u origin master
protoc -I helloworld/ helloworld/helloworld.proto --go_out=plugins=grpc:helloworld
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。