Configuring golangci-lint
GoLand provides functionality to work with golangci-lint
. You can configure it to analyze and improve your Go code by enabling or disabling specific linters. In the terminology of GoLand, linters are inspections that detect problematic code in your project before you run it.
With GoLand, you can also use your golangci-lint configuration files to check your code in your CI pipeline and run the same linters in the IDE.

Set the executable path for golangci-lint
Press Ctrl+Alt+S to open settings and then select
.From the Executable list, select the path to the
golangci-lint
executable.If the path is not detected automatically, click the plus icon and choose one of the following options:
Browse: use the file browser to select the path to the
golangci-lint
executable.Download: download and install the
golangci-lint
executable to a directory accessible to your user.
Set the number of concurrent processes
Press Ctrl+Alt+S to open settings and then select
.In the Concurrency field, enter the number of operating system threads (
GOMAXPROCS
) that can executegolangci-lint
simultaneously.
Enable or disable specific linters
Press Ctrl+Alt+S to open settings and then select
.Review the list of linters in the table.
Select the checkbox next to a linter to enable it, or clear the checkbox to disable it.
Use a custom configuration file for golangci-lint
Press Ctrl+Alt+S to open settings and then select
.Select the Use config checkbox.
Specify the path to your custom configuration file in the input field.
When a configuration file is selected, the table fields become disabled. The IDE will use the settings and linters defined in the configuration file.
To edit the configuration file in the editor, click Edit. The configuration file is opened in the editor.
Adjust severity levels for linters
Press Ctrl+Alt+S to open settings and then select
.Click Configure severity to open the Inspections settings page, where you can adjust the severity levels for golangci-lint checks.
For more information about severity levels, refer to Change inspection severity.
Using results of golangci-lint in the editor
The results of golangci-lint
linters are highlighted in the editor based on the configured severity levels.

To view the results of golangci-lint
linters, click the Problems widget. The detected issues will appear in the Problems tool window.

Running golangci-lint in the terminal
From the main menu, select
.In the Terminal tool window, type:
golangci-lint run