From 4c70ca6f848c6bbed7f3a705f3cc3fd71698f793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 1 Nov 2024 18:02:12 +0800 Subject: [PATCH] fix --- handle_base.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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