From: Robert Griesemer Date: Mon, 29 Jul 2013 23:00:28 +0000 (-0700) Subject: go/parser: don't report name errors if DeclarationErrors is not set X-Git-Tag: go1.2rc2~901 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3eb9adeeb8261662f87d8cb20f5e1c95a2506228;p=gostls13.git go/parser: don't report name errors if DeclarationErrors is not set R=adonovan CC=golang-dev https://golang.org/cl/12072043 --- diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go index a0ac8d7131..c3245e375d 100644 --- a/src/pkg/go/parser/parser.go +++ b/src/pkg/go/parser/parser.go @@ -2385,7 +2385,7 @@ func (p *parser) parseFile() *ast.File { // Go spec: The package clause is not a declaration; // the package name does not appear in any scope. ident := p.parseIdent() - if ident.Name == "_" { + if ident.Name == "_" && p.mode&DeclarationErrors != 0 { p.error(p.pos, "invalid package name _") } p.expectSemi()