allow decoding into slices that are empty

This commit is contained in:
Mitchell Hashimoto 2015-11-07 11:30:53 -08:00
parent 9ca9a4e1c3
commit 54464e89f1

View File

@ -383,9 +383,7 @@ func (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value)
items = []ast.Node{n}
case *ast.ListType:
items = n.List
}
if items == nil {
default:
return fmt.Errorf("unknown slice type: %T", node)
}