diff --git a/rule/use-any.go b/rule/use-any.go index bdf3c936d..88160c2fa 100644 --- a/rule/use-any.go +++ b/rule/use-any.go @@ -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 diff --git a/testdata/use-any.go b/testdata/use-any.go index bc6e64759..9891e844f 100644 --- a/testdata/use-any.go +++ b/testdata/use-any.go @@ -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() }