Skip to content

Commit

Permalink
fix: rename rule
Browse files Browse the repository at this point in the history
  • Loading branch information
damif94 committed Jul 30, 2023
1 parent d6a9894 commit 4754873
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ List of all available rules. The rules ported from `golint` are left unchanged a
| [`use-any`](./RULES_DESCRIPTIONS.md#use-any) | n/a | Proposes to replace `interface{}` with its alias `any` | no | no |
| [`datarace`](./RULES_DESCRIPTIONS.md#datarace) | n/a | Spots potential dataraces | no | no |
| [`comment-spacings`](./RULES_DESCRIPTIONS.md#comment-spacings) | []string | Warns on malformed comments | no | no |
| [`redundant-import-alias`](./RULES_DESCRIPTIONS.md#redundant-import-alias) | []string | Warns on import aliases matching the imported package name | no | no |
| [`redundant-import-alias`](./RULES_DESCRIPTIONS.md#redundant-import-alias) | n/a | Warns on import aliases matching the imported package name | no | no |


## Configurable rules
Expand Down
2 changes: 1 addition & 1 deletion rule/redundant-import-alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (*RedundantImportAlias) Apply(file *lint.File, _ lint.Arguments) []lint.Fai
if getImportPackageName(imp) == imp.Name.Name {
failures = append(failures, lint.Failure{
Confidence: 1,
Failure: fmt.Sprintf("Import alias \"%s\" is not used", imp.Name.Name),
Failure: fmt.Sprintf("Import alias \"%s\" is redundant", imp.Name.Name),
Node: imp,
Category: "imports",
})
Expand Down
4 changes: 2 additions & 2 deletions testdata/redundant-import-alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import(
"strings"
_ "crypto/md5"
str "strings"
strings "strings" // MATCH /Import alias "strings" is not used/
strings "strings" // MATCH /Import alias "strings" is redundant/
crypto "crypto/md5"
md5 "crypto/md5" // MATCH /Import alias "md5" is not used/
md5 "crypto/md5" // MATCH /Import alias "md5" is redundant/
)

0 comments on commit 4754873

Please sign in to comment.