# Create tests

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

Generate test files and test functions from your Go source code, then add test cases and expected results.

Procedure: Generate test files

1. In the code editor, navigate to `Code | Generate` or press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (VSCode), `⌃ ⏎` (VSCode (macOS)).

2. Select what kind of a test you want to generate and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (VSCode), `⏎` (VSCode (macOS)). You can create test files for the following scopes:

* Empty test file

* Test for function

* Tests for selection: available when you select code in the editor

* Tests for file

* Tests for package

![Generate test files](https://resources.jetbrains.com/help/img/idea/2026.3/go_generate_test_file.png)

3. Complete the generated tests with input values and expected results. For a source file named `main.go`, GoLand creates or updates `main_test.go`.

## Navigate between tests and production code

In GoLand, you can jump between test functions or files and production code.

Procedure:

* In the editor, place the caret at the test function or at the test subject in the source code and press `Ctrl+Shift+T` (Windows), `⌘ ⇧ T` (macOS), `⌘ ⇧ T` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ T` (macOS System Shortcuts), `Ctrl+Shift+T` (XWin), `Ctrl+Shift+T` (GNOME), `Ctrl+Shift+T` (KDE), `Ctrl+Shift+T` (Emacs), `Ctrl+Shift+T` (Sublime Text), `Ctrl+Shift+T` (Sublime Text (macOS)), `Ctrl+Shift+T` (VSCode), `Ctrl+Shift+T` (VSCode (macOS)) (`Navigate | Test Subject` or `Navigate | Test`).

If several matching tests or source declarations exist, select one from the popup. If no test exists, you can [create one](#create-test).

![Jump to test](https://resources.jetbrains.com/help/img/idea/2026.3/go_jump_to_test.png)

