Fix a weakness in analyzer

main
Elie 2021-01-14 18:17:34 +01:00
parent 2bfa78c1dd
commit 6508ed4ec9
No known key found for this signature in database
GPG Key ID: 399AF69092C727B6
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ func (a Analyzer) getField(t reflect.Type, path []string) (reflect.StructField,
return a.getField(t.Elem(), path[1:])
default:
{
if field, ok := t.FieldByName(path[0]); ok && a.hasNestedFields(field.Type) {
if field, ok := t.FieldByName(path[0]); ok && a.hasNestedFields(field.Type) && len(path) > 1 {
return a.getField(field.Type, path[1:])
} else {
return field, ok