add exhaustive linter ()

* wip

more

add new files

run command fixes

more

* go.mod

* order

* same package

* review comment

* enable linter in .golangci.yml

* add testcase for default-signifies-exhaustive: true

* adjust runGoErrchk instead

* disable the linter

* cleanup

* more cleanup

* cleanup
This commit is contained in:
Nishanth Shanmugham 2020-05-29 19:01:46 +05:30 committed by GitHub
parent 71b2f04e88
commit f3376cab71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 102 additions and 6 deletions

View file

@ -17,9 +17,13 @@ import (
func runGoErrchk(c *exec.Cmd, files []string, t *testing.T) {
output, err := c.CombinedOutput()
assert.Error(t, err)
_, ok := err.(*exec.ExitError)
assert.True(t, ok, err)
// The returned error will be nil if the test file does not have any issues
// and thus the linter exits with exit code 0. So perform the additional
// assertions only if the error is non-nil.
if err != nil {
_, ok := err.(*exec.ExitError)
assert.True(t, ok, err)
}
// TODO: uncomment after deprecating go1.11
// assert.Equal(t, exitcodes.IssuesFound, exitErr.ExitCode())