Sponge 快速生成 go CRUD
sponge
stage init 初始化
遇到一个问题Error: go: cannot install cross-compiled binaries when GOBIN is set
在指定了 GOBIN 的时候使用 go install 跨平台编译会有问题,需要删除。(go env -w GOBIN='')stage plugins
查看安装的插件,安装全部插件使用 sponge plugins --install,需要指定 windows,否则安装的为 linux 可执行文件后续识别不到(go env -w GOOS=windows)
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0
go install github.com/go-dev-frame/sponge/cmd/protoc-gen-go-gin@latest
go install github.com/go-dev-frame/sponge/cmd/protoc-gen-go-rpc-tmpl@latest
go install github.com/go-dev-frame/sponge/cmd/protoc-gen-json-field@latest
$ sponge plugins
installed dependency plugins:
✔ go
✔ protoc
✔ protoc-gen-go
✔ protoc-gen-go-grpc
✔ protoc-gen-validate
✔ protoc-gen-gotag
✔ protoc-gen-go-gin
✔ protoc-gen-go-rpc-tmpl
✔ protoc-gen-json-field
✔ protoc-gen-openapiv2
✔ protoc-gen-doc
✔ swag
all dependency plugins installed.
生成代码
基于 sponge 自带模板方式:
版权声明
本文章由作者“衡于墨”创作,转载请注明出处,未经允许禁止用于商业用途
发布时间:2025年01月06日 11:22:44
备案号:
闽ICP备19015193号-1
关闭特效
评论区#
还没有评论哦,期待您的评论!
引用发言