fix(decode): let the later field win an equal-depth name clash
Assisted-by: GLM 5.3
This commit is contained in:
@@ -289,7 +289,7 @@ func newStructSchema(t reflect.Type) structSchema {
|
||||
name = f.Name
|
||||
}
|
||||
key := strings.ToLower(name)
|
||||
if existing, ok := s.byName[key]; !ok || depth < existing.depth {
|
||||
if existing, ok := s.byName[key]; !ok || depth <= existing.depth {
|
||||
s.byName[key] = structFieldLoc{index: path, depth: depth}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user