My template for cweill/gotests
Add gotests settings to ./vscode/settings.json
{
...,
"go.generateTestsFlags": [
"-template_dir",
"./path/to/ras0q/gotests-template/templates" // Or templates2
],
...
}- TDD
- Parallel test
- Use
map[string]struct(map key is testname) - Use google/go-cmp
example_map-errors-gomock-gocmp_test.go
- manage subtest names as map keys
- initialize receiver fields with
*gomock.Controller - can change to parallel test with a
-parallelflag - use following packages
- standard
errorspackage gomock: https://github.com/golang/mockgo-cmp: https://github.com/google/go-cmp
- standard