I want to execute subtests using the testify/suite
package.
I am declaring my Unit suite as follows
type UnitSuite struct {
suite.Suite
}
func TestUnitSuite(t *testing.T) {
suite.Run(t, &UnitSuite{})
}
and here is my subtest
func (us *UnitSuite) ΤestSomething() {
for i := range testVars {
i := i
us.T().Run(testVars[i].name, func(t *testing.T) {
...
Ι am getting the following linting warning for func(t *testing.T)
potentially unused parameter: 't'unusedparams
When trying to substitute with the testing suite's function T()
that is supposes to retrieve the testing
context
us.T().Run(testVars[i].name, func(us.T()) {
I get this error in func(us.T())
<-- errors out
missing ',' in parameter listsyntax
What is the way to go about this that does not produce neither errors nor linting warnings?