摘要:
github.com/go-playground/validator 范围约束 对于字符串、切片、数组和map,约束其长度。 len=10, min=6, max=10, gt=10。 对于数值,约束其取值。 min, max, eq, ne, gt, gte, lt, lte, oneof=6 8 阅读全文
posted @ 2023-01-08 06:35
厚礼蝎
阅读(381)
评论(0)
推荐(0)
摘要:
实现MarshalJSON() ([]byte, error) 方法 ,序列化后可以把原来的枚举数转化为枚举数对应的字符串 实现UnmarshalJSON([]byte) error方法,可以把byte中的枚举的字符串转化为对应枚举字符串的枚举数 实现String() string方法,方便按照我们 阅读全文
posted @ 2023-01-08 06:33
厚礼蝎
阅读(242)
评论(0)
推荐(0)
摘要:
使用命令启动服务 例如 初始化 vblog-api init 启动服务 vblog-api start -f etc/confit.toml 版本号 vblog-api -v 需要借助一个强大的CLI库 Cobra https://github.com/spf13/cobra 安装 go get - 阅读全文
posted @ 2023-01-08 06:17
厚礼蝎
阅读(33)
评论(0)
推荐(0)

浙公网安备 33010602011771号