Inspectopedia
 
2024.3

Redundant import alias

Info
Code Style
New
Last modified: 03 December 2024

Reports aliases of imported packages that may be omitted.

Usually, such aliases equal to the names of the imported packages, so aliases have no effect and one can use package names directly.

Example:

import fmt "fmt"

The fmt alias duplicates the package name that is also named "fmt". To delete the alias, use the Delete import alias quick-fix.

After the quick-fix is applied:

import "fmt"