when the Unmarshaler parsing value by fillSliceFromString, if the val… (#3927)

Co-authored-by: danahan <danahan@tencent.com>
master^2
fffreedom 9 months ago committed by GitHub
parent cb8161c799
commit e38cb0118d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -223,11 +223,11 @@ func (u *Unmarshaler) fillSliceFromString(fieldType reflect.Type, value reflect.
switch v := mapValue.(type) { switch v := mapValue.(type) {
case fmt.Stringer: case fmt.Stringer:
if err := jsonx.UnmarshalFromString(v.String(), &slice); err != nil { if err := jsonx.UnmarshalFromString(v.String(), &slice); err != nil {
return err return fmt.Errorf("fullName: `%s`, error: `%w`", fullName, err)
} }
case string: case string:
if err := jsonx.UnmarshalFromString(v, &slice); err != nil { if err := jsonx.UnmarshalFromString(v, &slice); err != nil {
return err return fmt.Errorf("fullName: `%s`, error: `%w`", fullName, err)
} }
default: default:
return errUnsupportedType return errUnsupportedType

Loading…
Cancel
Save