Fix consul test case
This commit is contained in:
parent
95d9b2e530
commit
61bd5db85c
@ -451,6 +451,10 @@ func (d *decoder) decodeStruct(name string, raw ast.Node, result reflect.Value)
|
||||
// Create the field name and decode
|
||||
fieldName = fmt.Sprintf("%s.%s", name, fieldName)
|
||||
for _, elem := range elems {
|
||||
if obj, ok := elem.(ast.ObjectNode); ok {
|
||||
elem = obj.Elem[0].Value
|
||||
}
|
||||
|
||||
if err := d.decode(fieldName, elem, field); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ block:
|
||||
| blockId block
|
||||
{
|
||||
obj := ast.ObjectNode{
|
||||
K: $2.Key(),
|
||||
K: $1,
|
||||
Elem: []ast.AssignmentNode{$2},
|
||||
}
|
||||
|
||||
|
2
hcl/y.go
2
hcl/y.go
@ -455,7 +455,7 @@ hcldefault:
|
||||
//line parse.y:131
|
||||
{
|
||||
obj := ast.ObjectNode{
|
||||
K: hclS[hclpt-0].aitem.Key(),
|
||||
K: hclS[hclpt-1].str,
|
||||
Elem: []ast.AssignmentNode{hclS[hclpt-0].aitem},
|
||||
}
|
||||
|
||||
|
@ -11,5 +11,5 @@ key "foo/bar/" {
|
||||
}
|
||||
|
||||
key "foo/bar/baz" {
|
||||
polizy = "deny"
|
||||
policy = "deny"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user