diff --git a/node.go b/node.go index 3948e52..4b7920b 100644 --- a/node.go +++ b/node.go @@ -1541,7 +1541,7 @@ func (this *conversionState) convertAssignment(n *assign.Assign, isTopLevelState return "", parseErr{dimf, err} } - ret := arrayVar + ` = append(` + arrayVar + `, ` + rvalue + `)` + ret := arrayVar + ` = append(` + arrayVar + `, ` + removeParens(rvalue) + `)` if isTopLevelStatement { ret += "\n" } @@ -1559,6 +1559,7 @@ func (this *conversionState) convertAssignment(n *assign.Assign, isTopLevelState // TODO this may need to use `:=` if isTopLevelStatement { + rvalue = removeParens(rvalue) // safe in top-level assignment context // If this is a simple expression (func call; indirect/method call; assignment of func/method call) then // we need to propagate errors