Skip to content

Commit

Permalink
checkers: fix equalFold rules autofix templates (#1178)
Browse files Browse the repository at this point in the history
Removed a typo from a `Suggest()` string.
  • Loading branch information
quasilyte committed Dec 30, 2021
1 parent b808007 commit 27e5601
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions checkers/rules/rules.go
Expand Up @@ -569,7 +569,7 @@ func equalFold(m dsl.Matcher) {
`strings.ToUpper($x) == strings.ToUpper($y)`,
`$x == strings.ToUpper($y)`).
Where(m["x"].Pure && m["y"].Pure && m["x"].Text != m["y"].Text).
Suggest(`strings.EqualFold($x, $y)]`).
Suggest(`strings.EqualFold($x, $y)`).
Report(`consider replacing with strings.EqualFold($x, $y)`)

// string != patterns
Expand All @@ -581,7 +581,7 @@ func equalFold(m dsl.Matcher) {
`strings.ToUpper($x) != strings.ToUpper($y)`,
`$x != strings.ToUpper($y)`).
Where(m["x"].Pure && m["y"].Pure && m["x"].Text != m["y"].Text).
Suggest(`!strings.EqualFold($x, $y)]`).
Suggest(`!strings.EqualFold($x, $y)`).
Report(`consider replacing with !strings.EqualFold($x, $y)`)

// bytes.Equal patterns
Expand All @@ -593,7 +593,7 @@ func equalFold(m dsl.Matcher) {
`bytes.Equal(bytes.ToUpper($x), bytes.ToUpper($y))`,
`bytes.Equal($x, bytes.ToUpper($y))`).
Where(m["x"].Pure && m["y"].Pure && m["x"].Text != m["y"].Text).
Suggest(`bytes.EqualFold($x, $y)]`).
Suggest(`bytes.EqualFold($x, $y)`).
Report(`consider replacing with bytes.EqualFold($x, $y)`)
}

Expand Down
6 changes: 3 additions & 3 deletions checkers/rulesdata/rulesdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 27e5601

Please sign in to comment.