The simplest way of creating a new test file in GoLand is by using a dedicated shortcut that you can invoke from your source code. In this case, the IDE creates a new test file and generates test code for this file, package, or function.
Generate test files
In the code editor, navigate toor press Alt+Insert.
Select what kind of a test you want to generate and press Enter. You can create test files for the following scopes:
Empty test file
Test for function
Tests for file
Tests for package
Navigate between test code and source code
In GoLand, you can jump between the test classes and the source code.
In the editor, place the caret at the test class or at the test subject in the source code and press Ctrl+Shift+T (or ).
If the IDE can't find the test file, it will prompt you to add it.