mirror of
https://github.com/golang/go
synced 2024-11-22 02:14:40 -07:00
go/parser: package name must not be the blank identifier
R=r, r2, rsc1 CC=golang-dev https://golang.org/cl/4343045
This commit is contained in:
parent
7b40095e8c
commit
c42b3e21c3
@ -2209,6 +2209,9 @@ 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 == "_" {
|
||||
p.error(p.pos, "invalid package name _")
|
||||
}
|
||||
p.expectSemi()
|
||||
|
||||
var decls []ast.Decl
|
||||
|
Loading…
Reference in New Issue
Block a user