go t.Parallel
usage of t.Parallel in testing package in Go code:go
func TestA(t *testing.T) {
t.Parallel() // this function can be run in parallel
tests := []struct{
desc string
...
}{
{
...
},
...
}
for _, tc := range tests {
tc := tc // capture variable
t.Run(tc.name, func(t *testing.T) {
t.Parallel() // this test case can be run in parallel
...
})
}
}
linter for this