mirror of https://github.com/golang/go.git
checks if specs exist before accessing them in genDecl printer
This commit is contained in:
parent
bf94fc3ae3
commit
54cf699c96
|
|
@ -1568,7 +1568,7 @@ func (p *printer) genDecl(d *ast.GenDecl) {
|
|||
}
|
||||
p.print(d.Rparen, token.RPAREN)
|
||||
|
||||
} else {
|
||||
} else if len(d.Specs) > 0 {
|
||||
// single declaration
|
||||
p.spec(d.Specs[0], 1, true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue