simplify impl

This commit is contained in:
Mauri de Souza Meneguzzo 2023-10-17 12:11:38 -03:00
parent f36a0f17ec
commit 51d4b920b3
1 changed files with 1 additions and 10 deletions

View File

@ -1739,16 +1739,7 @@ func (p *printer) genDecl(d *ast.GenDecl) {
p.setPos(d.Pos())
p.print(d.Tok, blank)
// Empty decls for "var ()", "const ()", "import ()"
if len(d.Specs) == 0 && d.Lparen == token.NoPos && d.Rparen == token.NoPos {
switch d.Tok {
case token.VAR, token.CONST, token.IMPORT:
p.print(token.LPAREN, token.RPAREN)
return
}
}
if d.Lparen.IsValid() || len(d.Specs) > 1 {
if d.Lparen.IsValid() || len(d.Specs) != 1 {
// group of parenthesized declarations
p.setPos(d.Lparen)
p.print(token.LPAREN)