mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
check param, result, type param of function in redefines-builtin-id rule (#1023)
* check param, result, type param of function in redefines-builtin-id rule * combine the if statements * tiny refactoring to make it more Go idiomatic --------- Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
This commit is contained in:
11
testdata/redefines-builtin-id.go
vendored
11
testdata/redefines-builtin-id.go
vendored
@@ -41,3 +41,14 @@ func foo() {
|
||||
_ = max
|
||||
_ = min
|
||||
}
|
||||
|
||||
func foo1(new int) { // MATCH /redefinition of the built-in function new/
|
||||
_ = new
|
||||
}
|
||||
|
||||
func foo2() (new int) { // MATCH /redefinition of the built-in function new/
|
||||
return
|
||||
}
|
||||
|
||||
func foo3[new any]() { // MATCH /redefinition of the built-in function new/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user