diff --git a/handle_base.go b/handle_base.go index a876d09..3dce330 100644 --- a/handle_base.go +++ b/handle_base.go @@ -8,7 +8,6 @@ package validator import ( - "errors" "fmt" "git.zhangdeman.cn/gateway/validator/define" "git.zhangdeman.cn/zhangdeman/util" @@ -121,7 +120,7 @@ func handleString(inputVal any, rule *define.FieldRule) (string, error) { // 传入的不是string类型 if rule.DisableAutoConvert { // 禁用类型转换 - return "", errors.Errorf("%v : filed type is %v, data value auto convert is disabled, input value type is %v", rule.Path, rule.Type, reflect.TypeOf(inputVal).Kind().String()) + return "", fmt.Errorf("%v : filed type is %v, data value auto convert is disabled, input value type is %v", rule.Path, rule.Type, reflect.TypeOf(inputVal).Kind().String()) } if err = util.ConvertAssign(&formatData, inputVal); nil != err { return "", err