From 51d4b920b35a0c0d3231c59e728705c4e1d2ac26 Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Tue, 17 Oct 2023 12:11:38 -0300 Subject: [PATCH] simplify impl --- src/go/printer/nodes.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/go/printer/nodes.go b/src/go/printer/nodes.go index de0e4ac9be..a4651e0608 100644 --- a/src/go/printer/nodes.go +++ b/src/go/printer/nodes.go @@ -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)