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
|
// Create the field name and decode
|
||||||
fieldName = fmt.Sprintf("%s.%s", name, fieldName)
|
fieldName = fmt.Sprintf("%s.%s", name, fieldName)
|
||||||
for _, elem := range elems {
|
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 {
|
if err := d.decode(fieldName, elem, field); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ block:
|
|||||||
| blockId block
|
| blockId block
|
||||||
{
|
{
|
||||||
obj := ast.ObjectNode{
|
obj := ast.ObjectNode{
|
||||||
K: $2.Key(),
|
K: $1,
|
||||||
Elem: []ast.AssignmentNode{$2},
|
Elem: []ast.AssignmentNode{$2},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
hcl/y.go
2
hcl/y.go
@ -455,7 +455,7 @@ hcldefault:
|
|||||||
//line parse.y:131
|
//line parse.y:131
|
||||||
{
|
{
|
||||||
obj := ast.ObjectNode{
|
obj := ast.ObjectNode{
|
||||||
K: hclS[hclpt-0].aitem.Key(),
|
K: hclS[hclpt-1].str,
|
||||||
Elem: []ast.AssignmentNode{hclS[hclpt-0].aitem},
|
Elem: []ast.AssignmentNode{hclS[hclpt-0].aitem},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,5 +11,5 @@ key "foo/bar/" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
key "foo/bar/baz" {
|
key "foo/bar/baz" {
|
||||||
polizy = "deny"
|
policy = "deny"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user