Quickly generate json required in your launch.json for your Go subtests.
- Check if current file is a Go file
- Check if function is a Go test function (starts with 'Test')
- Checks if cursor is on a string and assumes this is the title of the subtest (this is the user's responsibility)
- Generates launch test configuration with the name function test name + sub test name
- Adds it to the launch.json file in the workspace (or if
useClipboard
is enabled, the JSON is copied to the clipboard instead)
Requires the Go VSCode extension in order to parse symbols and determine you are in a test function.
This extension does not support multi-root workspaces and will just use the one it retrieves first from the API to determine the launch.json file it needs to inject to.
This extension contributes the following settings:
"go-subtest.useClipboard"
: false When enabled, pastes the generated json for the subtest into your clipboard instead of adding it directly to your launch.json (for those that want to self manged)
Debug logs show an error: Failed to list imports: {err}
but this doesn't seem to impact the extension.
Users appreciate release notes as you update your extension.
Initial release of go-subtest
- add your subtest to launch.json or copy to your clipboard with the setting
"go-subtest.useClipboard": true
- go to your subtest config in launch.json
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Enjoy!