tests... pass

This commit is contained in:
Mitchell Hashimoto 2015-11-07 00:21:44 -08:00
parent e370e34aeb
commit 671ef91008

View File

@ -531,11 +531,14 @@ func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value)
var decodeNode ast.Node
matches := list.Prefix(fieldName)
if len(matches.Items) == 0 {
item := list.Get(fieldName)
if item == nil {
single := list.Get(fieldName)
if single == nil {
continue
}
decodeNode = item.Val
decodeNode = single.Val
if ot, ok := decodeNode.(*ast.ObjectType); ok {
decodeNode = &ast.ObjectList{Items: ot.List.Items}
}
} else {
decodeNode = matches
}