# Code coverage

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

> **TL;DR**
> Manage suites: `Run | Manage Coverage Reports` `Ctrl+Alt+F6` (Windows), `⌘ ⌥ F6` (macOS), `⌘ ⌥ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ F6` (macOS System Shortcuts), `Ctrl+Alt+6` (XWin), `Ctrl+Alt+6` (GNOME), `Ctrl+Alt+6` (KDE), `Ctrl+Alt+F6` (Emacs), `Ctrl+Alt+F6` (Sublime Text), `⌘ ⌥ F6` (Sublime Text (macOS)), `Ctrl+Alt+F6` (VSCode), `⌘ ⌥ F6` (VSCode (macOS))
>
>
>
> Coverage settings: `Settings `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)) | Build, Execution, Deployment | Coverage`

Code coverage in GoLand lets you analyze which lines of code were executed during a particular run. It helps determine the share of code covered by tests and identify areas that lack sufficient test coverage.

## Run with coverage

To analyze code coverage in your project, you need to run your application in the dedicated Run with Coverage mode.

Procedure:

The entry points for running coverage analysis are the same as you would normally use to [run an application](running-applications.html):

* For a main function or test function, click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.execute.svg) Run in the editor gutter, then select Run with Coverage

![A popup appears on clicking the gutter Run icon](https://resources.jetbrains.com/help/img/idea/2026.3/go-run-coverage-from-gutter-ij.png)

* For [run configurations](run-debug-configuration.html), click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.more.svg) More Actions in the [Run widget](new-ui.html#window_header), then select Run with Coverage

![A menu appears on clicking More Actions in the Run widget](https://resources.jetbrains.com/help/img/idea/2026.3/go-run-coverage-from-run-widget-ij.png)

GoLand uses Go's built-in coverage tools to record which parts of your code run. After the run finishes, the IDE displays the coverage results for your production Go files. Test files are not included in coverage highlighting.

> **Note:**
> Coverage for a Go Application configuration requires Go 1.20 or later.

## Coverage suites

A coverage suite is a collection of code coverage data from a specific run. Each coverage suite stores data from either a single run configuration (if it was [run with coverage](#run_with_coverage)) or from an [imported coverage data file](#add-remove-coverage-suite).

GoLand stores coverage suites in the `coverage` folder of the [IDE system directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#system-directory):

Windows:
`%LOCALAPPDATA%\JetBrains\GoLand2026.3\coverage`

macOS:
`~/Library/Caches/JetBrains/GoLand2026.3/coverage`

Linux:
`~/.cache/JetBrains/GoLand2026.3/coverage`

GoLand can display results from one or more coverage suites at the same time, and you can select which suites to show. If multiple suites are selected, the IDE displays their merged results: this means that a line is considered covered if it was executed in at least one of the suites.

You can select which coverage results to display, import results from a file, or remove coverage suites.

Procedure: Select which coverage suites to display

The list of coverage suites becomes available after at least one [run with coverage](running-test-with-coverage.html).

1. In the main menu, go to `Run | Manage Coverage Reports…` (`Ctrl+Alt+F6` (Windows), `⌘ ⌥ F6` (macOS), `⌘ ⌥ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ F6` (macOS System Shortcuts), `Ctrl+Alt+6` (XWin), `Ctrl+Alt+6` (GNOME), `Ctrl+Alt+6` (KDE), `Ctrl+Alt+F6` (Emacs), `Ctrl+Alt+F6` (Sublime Text), `⌘ ⌥ F6` (Sublime Text (macOS)), `Ctrl+Alt+F6` (VSCode), `⌘ ⌥ F6` (VSCode (macOS))).

2. In the Choose Coverage Suite to Display dialog that opens, select the suites you want to display results from.

* If you want to hide all code coverage results, click No Coverage instead. This deselects all coverage suites and closes the dialog.

![View code coverage results](https://resources.jetbrains.com/help/img/idea/2026.3/go_view_coverage_results.png)

3. Click Show Selected.

GoLand loads the code coverage results   for the selected suites.

Procedure: Add and remove coverage suites

If you want to review code coverage results from a file that was generated outside GoLand (for example, by a build server or another developer), you can add the file as a separate coverage suite.

You can also remove suites from the IDE or completely delete them from disk.

1. In the main menu, go to `Run | Manage Coverage Reports…` (`Ctrl+Alt+F6` (Windows), `⌘ ⌥ F6` (macOS), `⌘ ⌥ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ F6` (macOS System Shortcuts), `Ctrl+Alt+6` (XWin), `Ctrl+Alt+6` (GNOME), `Ctrl+Alt+6` (KDE), `Ctrl+Alt+F6` (Emacs), `Ctrl+Alt+F6` (Sublime Text), `⌘ ⌥ F6` (Sublime Text (macOS)), `Ctrl+Alt+F6` (VSCode), `⌘ ⌥ F6` (VSCode (macOS))).

2. In the Choose Coverage Suite to Display dialog that opens, choose an action from the toolbar:

* To import an external coverage file, click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) Add and browse for the file. The files with coverage data generated by GoLand are saved to the `coverage` folder in the IDE [system directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#system-directory) by default.

* To remove a coverage suite from the IDE but keep it on disk, select the suite and click ![the Remove button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.remove.svg) Remove.

* To delete a coverage suite from both the IDE and the disk, select the suite and click ![the Delete button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.delete.svg) Delete.

## Read coverage data

GoLand shows coverage results in:

* Coverage tool window

* Project tool window

* Editor

> **Note:**
> Code coverage is only supported for the code that belongs to your current project.

Code coverage results are displayed in the Coverage tool window, in the Project tool window, and in the editor after you  [launch at least
one run configuration with coverage](#run_with_coverage).

### Project tool window

The Project tool window displays:

* the percentage of the covered classes and lines for directories

* the percentage of the covered methods and lines for classes

![Code coverage results in the Project tool window](https://resources.jetbrains.com/help/img/idea/2026.3/go-coverage-in-project-tw.png)

### Coverage tool window

![Coverage results in the Coverage tool window](https://resources.jetbrains.com/help/img/idea/2026.3/go-coverage-tw.png)

The Coverage tool window has the following options:

| Item | Description |
| --- | --- |
| ![the Navigate with Single Click button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.autoscrollToSource.svg) | If this option is on, GoLand automatically opens the selected item in the editor. Otherwise, you need to double-click items to open them. |
| ![the Always Select Opened Element button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.autoscrollFromSource.svg) | If this option is on, GoLand automatically locates in the tool window the files that you open in the editor. |
| ![the Import External Coverage Report button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.import.svg) |  Import a coverage suite from disk.  |

### Editor

The editor displays the coverage status of individual code lines. The status is indicated by color-coded markers in the gutter:

* Green (![Green highlight indicating full coverage](https://resources.jetbrains.com/help/img/idea/2026.3/go_full_code_coverage.png)): the code line was executed.

* Yellow (![Yellow highlight indicating partial coverage](https://resources.jetbrains.com/help/img/idea/2026.3/go_partial_code_coverage.png)): the code line was executed partially. This happens when the code line contains conditional logic (such as an `if/else` statement, a loop, or a `switch` statement), but only some of its branches were run.

* Red (![Red highlight indicating no coverage](https://resources.jetbrains.com/help/img/idea/2026.3/go_uncovered_code_coverage.png)): the code line was not executed.

To open a popup with coverage statistics for a specific line, click its coverage marker in the gutter.

## Hide coverage data

Procedure:

Do one of the following:

* Close the tab with coverage statistics in the Coverage tool window (`View | Tool Windows | Coverage`).

* Click coverage highlighting in the gutter and select Hide coverage.

## Configure code coverage

Procedure: Change colors of the coverage highlighting

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)) to open settings and then select `Editor | Color Scheme  | General`.

2. Alternatively, click ![the Edit Coverage Colors button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg) in the popup that opens on clicking the coverage indication line in the gutter.

3. In the list of components, expand the Line Coverage node and select a type of coverage: for example, Full, Partial or Uncovered.

4. Click the Foreground field to open the Select Color dialog.

5. Select a color, apply the changes, and close the dialog.

![Configure code coverage colors](https://resources.jetbrains.com/help/img/idea/2026.3/go_coverageColors.png)

## See also

### Concepts

[Run/debug configurations](run-debug-configuration.html)

### Reference

[Coverage](coverage-settings.html) [Coverage Tool Window](coverage-tool-window.html)

### External Links

