This VSCode extension will make it a little easier to write tests in golang by
generating the majority of the boiler plate needed for common tests.
To install the extension from VSCode:
Ctrl + P in VSCode
- Enter the following:
ext install Gauntface.gotest-snippets
Optionally, checkout the extension on the VisualStudio Marketplace here.
- Generate a table driven test
- Generate a diff statement (i.e. a want/got check)
- Generate a diff statement with options. This is equivalent to
gotest-diff except it'll set up the options array.
- Generate a
TestMain function with a
reset function you can use to reset
all global variables between tests.
- Generate an error comparison.
- Generate an error to inject into test cases (useful for consistency).