Live Template to write benchmark function

Write benchmarks quicker thanks to the builtin bench live template.

How to use:

Place the cursor at the file level in a _test.go file and start typing func. Select the Benchmark option from the suggested list and then complete this by writing the test name you desire.

Pro tip: You can invoke the Completion feature, ⌃␣ (macOS) / Ctrl+Space (Windows/Linux), to create benchmarks for methods too, not just functions.


Related Resources

Generate tests for generic functions
Use a shortcut to generate test files for your generic functions.
Integrated Go Playground
You can format and share your code, change the Go version, and run your code using the Go playground server.
Live Template to create a for loop in benchmark functions
Benchmark loops are repetitive, so let the IDE handle this for you