Suggestion for VSCode integration
Blog Post
https://hackandsla.sh/posts/2020-07-12-golang-integration-testing/
The Issue
This is not so much an issue but a suggestion/recommendation for an alternate integration into VSCode.
If you are not worried about your Unit and Integration tests coexisting in your local environment, you can simply add the build tags to VSCode's settings.json
under go test flags like so:
{
/*
The rest of your settings.json is up here
*/
"go.testFlags": ["-tags=integration"],
}
This brings back full support for the run and debug links in the editor without the need for the launch.json
stuff, or remembering to highlight the name of the test function before starting a debug session (though, I wasn't aware of the ${selectedText}
place holder, and find this to be a novel addition to the article).
Thanks for the great article though. It was super helpful!