allow decoding into slices that are empty
This commit is contained in:
parent
9ca9a4e1c3
commit
54464e89f1
@ -383,9 +383,7 @@ func (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value)
|
|||||||
items = []ast.Node{n}
|
items = []ast.Node{n}
|
||||||
case *ast.ListType:
|
case *ast.ListType:
|
||||||
items = n.List
|
items = n.List
|
||||||
}
|
default:
|
||||||
|
|
||||||
if items == nil {
|
|
||||||
return fmt.Errorf("unknown slice type: %T", node)
|
return fmt.Errorf("unknown slice type: %T", node)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user