golang protobuf
安装protoc在https://github.com/google/protobuf/releases下载protoc-3.7.0-win64.zip解压后,将bin文件夹下的protoc.exe复制到GOPATH/bin下即可(放这个目录是因为,我们的GOROOT在配置GoLang环境的时候,GoLang已经帮我们设置好了环境变量,如果你要放其他目录,那么要自己去设置环境变量)。
安装 protoc-gen-go
protoc-gen-go是protobuf编译插件系列中的Go版本。从上一小节知道原生的protoc并不包含Go版本的插件
由于protoc-gen-go是Go写的,下载地址:https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.27.1
将文件夹中的 protoc-gen-go.exe 放在 %GOROOT%下。
[*]生产protocol文件
protoc --go_out=plugins=grpc:. bsn-service-protos/protos/fabricService/nodemgmtService.proto
页:
[1]