configs/configupgrade: Use single-line syntax for empty object exprs

This commit is contained in:
Martin Atkins 2019-05-15 15:56:30 -07:00
parent bec4641867
commit 004c2056a7
3 changed files with 12 additions and 0 deletions

View File

@ -4,8 +4,12 @@ variable "s" {
variable "l" {
type = "list"
default = []
}
variable "m" {
type = "map"
default = {}
}

View File

@ -4,8 +4,12 @@ variable "s" {
variable "l" {
type = list(string)
default = []
}
variable "m" {
type = map(string)
default = {}
}

View File

@ -184,6 +184,10 @@ Value:
buf.WriteString("]")
case *hcl1ast.ObjectType:
if len(tv.List.Items) == 0 {
buf.WriteString("{}")
break
}
buf.WriteString("{\n")
for _, item := range tv.List.Items {
if len(item.Keys) != 1 {