fix: test failure (#2874)

master
Kevin Wan 2 years ago committed by GitHub
parent 84f9863b63
commit 434973c206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -853,10 +853,12 @@ func (u *Unmarshaler) unmarshalWithFullName(m valuerWithParent, v any, fullName
numFields := baseType.NumField() numFields := baseType.NumField()
for i := 0; i < numFields; i++ { for i := 0; i < numFields; i++ {
if !baseType.Field(i).IsExported() { field := baseType.Field(i)
if !field.IsExported() {
continue continue
} }
if err := u.processField(baseType.Field(i), valElem.Field(i), m, fullName); err != nil {
if err := u.processField(field, valElem.Field(i), m, fullName); err != nil {
return err return err
} }
} }

@ -793,7 +793,9 @@ func TestUnmarshalStringMapFromNotSettableValue(t *testing.T) {
} }
ast := assert.New(t) ast := assert.New(t)
ast.Error(UnmarshalKey(m, &v)) ast.NoError(UnmarshalKey(m, &v))
assert.Empty(t, v.sort)
assert.Nil(t, v.psort)
} }
func TestUnmarshalStringMapFromString(t *testing.T) { func TestUnmarshalStringMapFromString(t *testing.T) {

Loading…
Cancel
Save