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