1
0
mirror of https://github.com/mgechev/revive.git synced 2025-02-07 13:31:42 +02:00

fix: change "GO" to "Go" in the use-any rule (#1077)

This commit is contained in:
Oleksandr Redko 2024-11-04 14:18:50 +02:00 committed by GitHub
parent 9a8587cc49
commit fa9af82039
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -47,7 +47,7 @@ func (w lintUseAny) Visit(n ast.Node) ast.Visitor {
Node: n,
Confidence: 1,
Category: "naming",
Failure: "since GO 1.18 'interface{}' can be replaced by 'any'",
Failure: "since Go 1.18 'interface{}' can be replaced by 'any'",
})
return w

20
testdata/use-any.go vendored
View File

@ -1,19 +1,19 @@
package pkg
var i interface{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
var i interface{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
type t interface{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
type a = interface{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
type t interface{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
type a = interface{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
func any1(a interface{}) { // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
m1 := map[interface{}]string{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
m2 := map[int]interface{}{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
a := []interface{}{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
m3 := make(map[int]interface{}, 1) // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
a2 := make([]interface{}, 2) // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
func any1(a interface{}) { // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
m1 := map[interface{}]string{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
m2 := map[int]interface{}{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
a := []interface{}{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
m3 := make(map[int]interface{}, 1) // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
a2 := make([]interface{}, 2) // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
}
func any2(a int) interface{} {} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/
func any2(a int) interface{} {} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/
var ni interface{ Close() }