From: Robert Griesemer Date: Thu, 9 Jan 2014 22:51:23 +0000 (-0800) Subject: go/parser: slightly improved error message by adding hint X-Git-Tag: go1.3beta1~1017 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8a089c07ec13c2c9d3f721f2236624f6284b7877;p=gostls13.git 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 --- 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()} }