Support Elem on lists
This commit is contained in:
parent
bf89042e7b
commit
1a9d040ea4
@ -198,6 +198,10 @@ func (d *decoder) decodeMap(name string, o *hcl.Object, result reflect.Value) er
|
||||
// Go through each element and decode it.
|
||||
current := o
|
||||
for current != nil {
|
||||
if current.Value == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
m := current.Value.([]*hcl.Object)
|
||||
for _, o := range m {
|
||||
// Make the field name
|
||||
|
@ -69,12 +69,14 @@ func (o *Object) Elem(expand bool) []*Object {
|
||||
return result
|
||||
}
|
||||
|
||||
switch o.Type {
|
||||
case ValueTypeObject:
|
||||
if o.Value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch o.Type {
|
||||
case ValueTypeList:
|
||||
return o.Value.([]*Object)
|
||||
case ValueTypeObject:
|
||||
return o.Value.([]*Object)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user