Code Inspections in Go modules
This topic lists all GoLand code inspections available in Go modules.
You can toggle specific inspections or change their severity level on the Editor | Inspections page of the IDE settings Control+Alt+S.
General
Inspection | Description | Default Severity |
---|---|---|
Migration to Go workspace is possible | Generates 'go.work' files using 'replace' directives. Go workspaces is a feature introduced in Go 1.18 that allows working simultaneously on several modules. By default, the 'warning' severity is used. If a generated workspace would include Go modules that were not replaced in the original 'go.mod', no warning is shown due to possible side effects caused by migration. But you can still run the fix manually. For more information about workspaces, refer to Go Modules Reference. | Warning |
Declaration redundancy
Inspection | Description | Default Severity |
---|---|---|
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 The inspection processes The inspection might not accurately determine that a replaced or indirectly-required dependency is unused in the following cases:
| Warning |