Skip to content

Commit

Permalink
Ignore invalid field for decoding embedded struct (#22)
Browse files Browse the repository at this point in the history
Ignore invalid field for decoding embedded struct
  • Loading branch information
goccy authored Nov 6, 2019
2 parents d3ad304 + 3ca6d06 commit 5b10b65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ func (d *Decoder) setDefaultValueIfConflicted(v reflect.Value, fieldMap StructFi
}
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
if isIgnoredStructField(field) {
continue
}
structField := embeddedStructFieldMap[field.Name]
if !fieldMap.isIncludedRenderName(structField.RenderName) {
continue
Expand Down

0 comments on commit 5b10b65

Please sign in to comment.