# Create tests

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

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

<a id="create-test"></a>

Procedure: Generate test files

1. In the code editor, navigate to `Code | Generate` or press [Generate… shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "Generate").

2. Select what kind of a test you want to generate and press [Enter shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter"). 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`.

<a id="test-code-navigation"></a>

## 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 [Go to Test shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "GotoTest") (`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)

