From b9a183210575ed56b072f1f798be12ea4d0d2268 Mon Sep 17 00:00:00 2001 From: Connor Newton Date: Sat, 25 Aug 2018 13:23:43 +0100 Subject: [PATCH] Fix Config.idFor() recursive ID lookup in anonymous fields (fixes #732) Prefix was not being propagated in second pass so was only correct at first level where pref == "" --- schema/schema.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/schema.go b/schema/schema.go index ab275741e..c82e873bf 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -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 }