Hi Gophers!
We were unhappy with the common unit test styles and we think we found a style that has clear advantages. An in-depth comparison can be found here https://symflower.com/en/company/blog/2022/better-table-driven-testing/.
We also added support for maintaining such tests in our VS Code extension https://marketplace.visualstudio.com/items?itemName=symflower.symflower. You can either use the command or the context menu item to maintain tests.
There are some changes necessary to have better stack traces for because “t.Run” calls the test function from another location. We are in the process of upstreaming them.
Would appreciate your feedback on the style and extension. Would be also interesting to hear other approaches and conventions that could help others to write better tests.
Cheers,
Markus