mirror of
https://github.com/astaxie/beego.git
synced 2025-07-10 11:30:20 +00:00
validation: support required option for some struct tag valids
This commit is contained in:
@ -64,6 +64,9 @@ Struct Tag Use:
|
||||
|
||||
func main() {
|
||||
valid := validation.Validation{}
|
||||
// ignore empty field valid
|
||||
// see CanSkipFuncs
|
||||
// valid := validation.Validation{RequiredFirst:true}
|
||||
u := user{Name: "test", Age: 40}
|
||||
b, err := valid.Valid(u)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user