-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
How to reproduce
1> go get github.com/golangci/golangci-lint/cmd/golangci-lint@master (as the latest change is not in the release)
2> Set the linter to use tParallel
3> Run golangci-lint run ./...
Code to run the tests on
package main
func Add(i, j int) int {
return i + j
}
package main
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Add(t *testing.T) {
testCases := []struct {
name string
val1 int
val2 int
expectedResult int
}{
{
name: "add correct",
val1: 2,
val2: 4,
expectedResult: 6,
},
{
name: "add negative",
val1: -2,
val2: -4,
expectedResult: -6,
},
}
for _, tc := range testCases {
fmt.Println(tc.name)
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
assert.Equal(t, tc.expectedResult, Add(tc.val1, tc.val2))
})
}
}
I would've expected the linter to tell me that there is no t.Parallel being called.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
