Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rule/use-any.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions testdata/use-any.go
Original file line number Diff line number Diff line change
@@ -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() }

Expand Down
Loading