mirror of
https://github.com/mgechev/revive.git
synced 2025-03-17 20:57:58 +02:00
parent
b2bc00bd75
commit
10d4f5fb1c
@ -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
|
||||
|
3
testdata/redefines-builtin-id.go
vendored
3
testdata/redefines-builtin-id.go
vendored
@ -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 ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user