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 6546ea0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
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
11 changes: 2 additions & 9 deletions testdata/redundant-import-alias.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package fixtures

import(
"crypto/md5"
"strings"
_ "crypto/md5"
str "strings"
strings "strings" // MATCH /Import alias "strings" is not used/
crypto "crypto/md5"
md5 "crypto/md5" // MATCH /Import alias "md5" is not used/
import (
_ "crypto/md5"
)

0 comments on commit 6546ea0

Please sign in to comment.