Skip to content

Commit 10d4f5f

Browse files
authored
fix issue #792 (#793)
1 parent b2bc00b commit 10d4f5f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rule/redefines-builtin-id.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ func (w *lintRedefinesBuiltinID) Visit(node ast.Node) ast.Visitor {
8989
case *ast.GenDecl:
9090
switch n.Tok {
9191
case token.TYPE:
92+
if len(n.Specs) < 1 {
93+
return nil
94+
}
9295
typeSpec, ok := n.Specs[0].(*ast.TypeSpec)
9396
if !ok {
9497
return nil

testdata/redefines-builtin-id.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ var any int // MATCH /redefinition of the built-in type any/
2929
const any = 1 // MATCH /redefinition of the built-in type any/
3030

3131
var i, copy int // MATCH /redefinition of the built-in function copy/
32+
33+
// issue #792
34+
type ()

0 commit comments

Comments
 (0)