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,11 +178,9 @@ func (p *printer) objectItem(o *ast.ObjectItem) []byte {
buf.WriteByte(blank)
// reach end of key
if i == len(o.Keys)-1 {
if o.Assign.IsValid() && len(o.Keys) == 1 {
buf.WriteString("=")
buf.WriteByte(blank)
}
if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 {
buf.WriteString("=")
buf.WriteByte(blank)
}
}