mirror of
https://gitee.com/johng/gf
synced 2026-07-08 22:40:30 +08:00
add context for package gvalid.Check* functions
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/util/gvalid"
|
||||
@ -17,7 +18,7 @@ func main() {
|
||||
"password@required|length:6,16|same:password2#密码不能为空}|两次密码输入不相等",
|
||||
"password2@required|length:6,16#",
|
||||
}
|
||||
if e := gvalid.CheckMap(params, rules); e != nil {
|
||||
if e := gvalid.CheckMap(context.TODO(), params, rules); e != nil {
|
||||
fmt.Println(e.Map())
|
||||
fmt.Println(e.FirstItem())
|
||||
fmt.Println(e.FirstString())
|
||||
|
||||
Reference in New Issue
Block a user