[release-branch.go1.9] cmd/compile: simplify "missing function body" error message

Fixes #21747.

Change-Id: I6a68370be3b7510ce364ddd1e41a1d767ce3a67f
Reviewed-on: https://go-review.googlesource.com/61311
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/70972
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Matthew Dempsky 2017-09-03 12:31:14 -07:00 committed by Russ Cox
parent 2e4358c960
commit ccd5abc105

View file

@ -401,7 +401,7 @@ func (p *noder) funcDecl(fun *syntax.FuncDecl) *Node {
f.Func.Endlineno = lineno
} else {
if pure_go || strings.HasPrefix(f.funcname(), "init.") {
yyerrorl(f.Pos, "missing function body for %q", f.funcname())
yyerrorl(f.Pos, "missing function body")
}
}