Skip to content

Commit

Permalink
Fix Config.idFor() recursive ID lookup in anonymous fields (fixes #732)
Browse files Browse the repository at this point in the history
Prefix was not being propagated in second pass so was only correct at
first level where pref == ""
  • Loading branch information
phyrwork committed Aug 25, 2018
1 parent 243214c commit b9a1832
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ func (c *Config) idFor(rules fieldRules, rt reflect.Type, rv reflect.Value, pref
if !fld.Anonymous {
continue
}
id, err = c.idFor(rules, fld.Type, rv.Field(i), fld.Name+".")
id, err = c.idFor(rules, fld.Type, rv.Field(i), pref+fld.Name+".")
if err != nil || id != nil {
return
}
Expand Down

0 comments on commit b9a1832

Please sign in to comment.