Configuring golangci-lint
Settings: Go | Linters.
Documentation: golangci-lint official site.
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.

Press CtrlAlt0S to open settings and then select Go | Linters.
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.
Press CtrlAlt0S to open settings and then select Go | Linters.
In the Concurrency field, enter the number of operating system threads (
GOMAXPROCS
) that can executegolangci-lint
simultaneously.
Press CtrlAlt0S to open settings and then select Go | Linters.
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.
Press CtrlAlt0S to open settings and then select Go | Linters.
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.
Press CtrlAlt0S to open settings and then select Go | Linters.
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.
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.

From the main menu, select View | Tool Windows | Terminal.
In the Terminal tool window, type:
golangci-lint run
Thanks for your feedback!