Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>gotest-snippetsNew to Visual Studio Code? Get it now.
gotest-snippets

gotest-snippets

Gauntface

|
5,908 installs
| (1) | Free
A handful of snippets to make writing tests for golang a little easier.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Image of the golang gopher in a shirt

gotest-snippets

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.

Installation

To install the extension from VSCode:

  1. Press Ctrl + P in VSCode
  2. Enter the following: ext install Gauntface.gotest-snippets

Optionally, checkout the extension on the VisualStudio Marketplace here.

Snippets

  • gotest
    • Generate a table driven test
  • gotest-diff
    • Generate a diff statement (i.e. a want/got check)
  • gotest-diffopts
    • Generate a diff statement with options. This is equivalent to gotest-diff except it'll set up the options array.
  • gotest-main
    • Generate aTestMain function with a reset function you can use to reset all global variables between tests.
  • gotest-errors
    • Generate an error comparison.
  • gotest-errinject
    • Generate an error to inject into test cases (useful for consistency).
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft