From 0704c168e18bf3c7113ae2d5967e68cc2c1ab6d9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 7 Nov 2015 15:15:40 -0800 Subject: [PATCH] hcl/printer: make boolean logic one line --- hcl/printer/nodes.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hcl/printer/nodes.go b/hcl/printer/nodes.go index 57f9f05..eba804b 100644 --- a/hcl/printer/nodes.go +++ b/hcl/printer/nodes.go @@ -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) } }