Unused dependency
Reports unused dependencies.
For each dependency in the current go.mod file, this inspection searches for any import statement starting with the dependency name in all GO files. If no such imports found then the dependency is considered unused. This inspection is an equivalent of the go mod why command.
The inspection processes require and replace directives. The require directives with // indirect comments are also processed.
The inspection might not accurately determine that a replaced or indirectly-required dependency is unused in the following cases:
Vendoring mode is enabled
Some dependencies are not downloaded
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
VgoUnusedDependency- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: VgoUnusedDependency
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: | |
Can be installed with plugin: | Go, 252.26654.0 |