Skip to content

Commit c17b55c

Browse files
committed
fix: handle old TODO
1 parent 7a612da commit c17b55c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/linters_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
assert "github.com/stretchr/testify/require"
1313
yaml "gopkg.in/yaml.v2"
1414

15+
"github.com/golangci/golangci-lint/pkg/exitcodes"
1516
"github.com/golangci/golangci-lint/test/testshared"
1617
)
1718

@@ -21,13 +22,11 @@ func runGoErrchk(c *exec.Cmd, defaultExpectedLinter string, files []string, t *t
2122
// and thus the linter exits with exit code 0. So perform the additional
2223
// assertions only if the error is non-nil.
2324
if err != nil {
24-
_, ok := err.(*exec.ExitError)
25-
assert.True(t, ok, err)
25+
var exitErr *exec.ExitError
26+
assert.ErrorAs(t, err, &exitErr)
27+
assert.Equal(t, exitcodes.IssuesFound, exitErr.ExitCode())
2628
}
2729

28-
// TODO: uncomment after deprecating go1.11
29-
// assert.Equal(t, exitcodes.IssuesFound, exitErr.ExitCode())
30-
3130
fullshort := make([]string, 0, len(files)*2)
3231
for _, f := range files {
3332
fullshort = append(fullshort, f, filepath.Base(f))

0 commit comments

Comments
 (0)