官方參考文檔: go install google.golang.org/protobuf/cmd/protoc-gen-go 安裝protobuf go 插件 https://developers.google.com/protocol-buffers/docs/reference/go-gene ...
官方參考文檔:
- go install google.golang.org/protobuf/cmd/protoc-gen-go 安裝protobuf go 插件
- https://developers.google.com/protocol-buffers/docs/reference/go-generated protobuf 官方參考教程
- https://developers.google.com/protocol-buffers/docs/gotutorial
- https://github.com/grpc/grpc-go/tree/master/cmd/protoc-gen-go-grpc protoc-gen-go插件安裝
安裝protobuf 工具:
比較簡單,直接github下載,編譯安裝即可; 編譯會安裝到/usr/local/下;安裝 protoc 工具;
安裝protoc-gen-go 工具:現在工具改變位置了,所以從官方主頁下載最新鏈接;
https://pkg.go.dev/mod/google.golang.org/protobuf 模塊主頁和說明
go get -u google.golang.org/protobuf 下載代碼
http://doc.oschina.net/grpc?t=56831 grpc 官方文檔中文版
https://github.com/grpc/grpc-go/tree/master/examples grpc-go 例子
go get -v github.com/grpc/grpc-go/cmd/protoc-gen-go-grpc go get -v github.com/golang/protobuf/protoc-gen-go cd dir; go install
國內可參考文檔:
https://blog.csdn.net/weixin_42366378/article/details/105722792 protobuf 語法簡介
https://geektutu.com/post/quick-go-protobuf.html 可參考
https://blog.csdn.net/weixin_44627989/article/details/106079336 可參考
測試代碼鏈接:https://github.com/yaowenxu/Workplace/tree/master/understand-go/pb