1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-17 20:57:58 +02:00
This commit is contained in:
chavacava 2023-02-18 10:57:06 +01:00 committed by GitHub
parent b2bc00bd75
commit 10d4f5fb1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -89,6 +89,9 @@ func (w *lintRedefinesBuiltinID) Visit(node ast.Node) ast.Visitor {
case *ast.GenDecl:
switch n.Tok {
case token.TYPE:
if len(n.Specs) < 1 {
return nil
}
typeSpec, ok := n.Specs[0].(*ast.TypeSpec)
if !ok {
return nil

View File

@ -29,3 +29,6 @@ var any int // MATCH /redefinition of the built-in type any/
const any = 1 // MATCH /redefinition of the built-in type any/
var i, copy int // MATCH /redefinition of the built-in function copy/
// issue #792
type ()