From 8a089c07ec13c2c9d3f721f2236624f6284b7877 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 9 Jan 2014 14:51:23 -0800 Subject: [PATCH] go/parser: slightly improved error message by adding hint It's difficult to make this much better w/o much more effort. This is a rare case and probably not worth it. Fixes #6052. R=golang-codereviews, bradfitz, adonovan CC=golang-codereviews https://golang.org/cl/49740045 --- src/pkg/go/parser/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go index c4523318f2..d8cde99de2 100644 --- a/src/pkg/go/parser/parser.go +++ b/src/pkg/go/parser/parser.go @@ -1752,7 +1752,7 @@ func (p *parser) makeExpr(s ast.Stmt) ast.Expr { if es, isExpr := s.(*ast.ExprStmt); isExpr { return p.checkExpr(es.X) } - p.error(s.Pos(), "expected condition, found simple statement") + p.error(s.Pos(), "expected condition, found simple statement (missing parentheses around composite literal?)") return &ast.BadExpr{From: s.Pos(), To: s.End()} } -- 2.48.1