hcl/printer: make boolean logic one line

This commit is contained in:
Mitchell Hashimoto 2015-11-07 15:15:40 -08:00
parent b24dfd1bb1
commit 0704c168e1

View File

@ -178,13 +178,11 @@ func (p *printer) objectItem(o *ast.ObjectItem) []byte {
buf.WriteByte(blank) buf.WriteByte(blank)
// reach end of key // reach end of key
if i == len(o.Keys)-1 { if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 {
if o.Assign.IsValid() && len(o.Keys) == 1 {
buf.WriteString("=") buf.WriteString("=")
buf.WriteByte(blank) buf.WriteByte(blank)
} }
} }
}
buf.Write(p.output(o.Val)) buf.Write(p.output(o.Val))