aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2014-01-09 14:51:23 -0800
committerRobert Griesemer <gri@golang.org>2014-01-09 14:51:23 -0800
commit8a089c07ec13c2c9d3f721f2236624f6284b7877 (patch)
tree3c73b847cc6405219100446da21e454a856fa6ba /src
parente598bf1c887e565d37bfccf7145fd01a2c655e31 (diff)
downloadgo-8a089c07ec13c2c9d3f721f2236624f6284b7877.tar.xz
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
Diffstat (limited to 'src')
-rw-r--r--src/pkg/go/parser/parser.go2
1 files changed, 1 insertions, 1 deletions
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()}
}