chore: refactor mapping errors (#3843)

This commit is contained in:
Kevin Wan
2024-01-13 22:11:19 +08:00
committed by GitHub
parent 0441f84606
commit 7822a4c1cb
3 changed files with 4 additions and 2 deletions

View File

@@ -250,8 +250,9 @@ func (u *Unmarshaler) fillSliceFromString(fieldType reflect.Type, value reflect.
func (u *Unmarshaler) fillSliceValue(slice reflect.Value, index int,
baseKind reflect.Kind, value any, fullName string) error {
if value == nil {
return errUnsupportedType
return errNilSliceElement
}
ithVal := slice.Index(index)
switch v := value.(type) {
case fmt.Stringer: