Inhere
Inhere
@sCuz12 Maybe you should add a custom validator like `isActiveURL` global add: ```go validate.AddValidator("isActiveURL", func(val string) bool { // ... check the URL: val // eg. http.Get(val) return true })...
可以先绑定到 struct,再验证 struct 数据。 要想先验证再绑定,可以参考 https://github.com/gookit/validate/blob/master/README.zh-CN.md#%E9%AA%8C%E8%AF%81%E8%AF%B7%E6%B1%82 只是这样操作有点麻烦
可以直接生成这样的不嘛? :)  https://github.com/gookit/validate/blob/master/README.zh-CN.md#%E4%BD%BF%E7%94%A8%E6%A0%87%E7%AD%BE%E5%BF%AB%E9%80%9F%E9%85%8D%E7%BD%AE%E9%AA%8C%E8%AF%81
它底层提供 validate interface 没有呢?像 gin 一样,可以直接嵌入 `gookit/validate` 替换默认的验证器。 ### 在gin框架中使用 可以在任何框架中使用 `validate`,例如 Gin、Echo、Chi 等。 这里以 gin 示例: ```go package main import ( "github.com/gin-gonic/gin/binding" "github.com/gookit/validate" ) // implements the binding.StructValidator type...
`api在定义时就已经定义好了参数的各种约束条件了,如果可以直接从这个定义时获取规则来验证请求的参数` 这估计得你手动处理了,解析拿到规则配置到验证上。。。 我没用过 go-zero。或许你可以参考它内部的处理逻辑来调整下
Here is a test report provided by others: https://github.com/StrayDragon/benchmark-validate-go **Performance optimization is still planned:** - [ ] Create Validation in a lighter way. eg: sync.Pool - [ ] The reflect.Type...
Please use `v.Errors`, see https://github.com/gookit/validate#validate-error
Ok, thanks. I will add a helper method on Errors. return like: ```json { "field": "Email", "message": "Email value is invalid email address" } ```
初始化gorm时,传实现了 grom 的log interface实例。这个实例不同级别的方法回调里,调用slog 实例记录日志就行
有简单的复现方法吗? > 在设置了 max backup 为 90 的情况下,只有3个备份。 -- 是不是还配置了按时间清理的