Protoc Gen Go

安装protobuf库

1
2
go get -u github.com/golang/protobuf/proto
go get -u github.com/golang/protobuf/protoc-gen-go

确认$GOPATH/bin下有protoc-gen-go.exe

下载protoc.exe

proto生成.go文件的工具 https://github.com/google/protobuf/releases

编译proto文件输出go文件

使用命令行编译

1
protoc.exe  --plugin=protoc-gen-go=E:\Go\Development\bin\protoc-gen-go.exe --go_out=./ --proto_path . test.proto
分享到: