This commit is contained in:
白茶清欢 2024-11-01 18:02:12 +08:00
parent 974063eb26
commit 4c70ca6f84

View File

@ -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