aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-10-31 16:36:17 +0000
committerNiall Sheridan <nsheridan@gmail.com>2016-10-31 16:40:08 +0000
commite0a1ccb64a637673195804513902cba6b1d4e97c (patch)
treeabc1598be28cda231d92cda8fb10b49eeb564c29 /vendor/github.com/hashicorp/hcl/json/parser/flatten.go
parent7bad329d417f19ba4aae2b4607281c2bc5df8ad7 (diff)
Update dependencies
Diffstat (limited to 'vendor/github.com/hashicorp/hcl/json/parser/flatten.go')
-rw-r--r--vendor/github.com/hashicorp/hcl/json/parser/flatten.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/hcl/json/parser/flatten.go b/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
index 6eb14a2..f652d6f 100644
--- a/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
+++ b/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
@@ -48,6 +48,12 @@ func flattenListType(
item *ast.ObjectItem,
items []*ast.ObjectItem,
frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) {
+ // If the list is empty, keep the original list
+ if len(ot.List) == 0 {
+ items = append(items, item)
+ return items, frontier
+ }
+
// All the elements of this object must also be objects!
for _, subitem := range ot.List {
if _, ok := subitem.(*ast.ObjectType); !ok {