mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.69k stars 273 forks source link

fix redunant-import-alias rule - unused alias is also redundant #950

Closed mfederowicz closed 6 months ago

mfederowicz commented 6 months ago

related with: #936

I think we should change definition of redundant alias, because import like this:

import apiv2 "cloud.google.com/go/run/apiv2" is ok i one condition: when alias apiv2 is used min one time in code below import, otherwise is redundant because is not used

of course this rule checks only imports with aliases, imports without aliases are ignored in this rule :)