下载安装protobuf https://github.com/google/protobuf/releases/
安装插件:
-
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
-
go get -u google.golang.org/grpc
-
protoc --go_out=plugins=grpc:. *.proto
提示:protoc: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
https://pkgs.org/download/libatomic.so.1
下载rpm包 安装即可
rpm -ivh libatomic-4.8.5-36.el7.x86_64.rpm