golangci-lint/test/testdata/errcheck_exclude.go
Denis Isaev 609de3254c Fix #331: fix errcheck "ignore" config directive.
Make tests for "ignore" and "exclude" directives.
Mark all hidden command-line options as deprecated.
2018-12-23 12:33:41 +03:00

19 lines
424 B
Go

//args: -Eerrcheck
//config: linters-settings.errcheck.check-blank=true
//config: linters-settings.errcheck.exclude=testdata/errcheck/exclude.txt
package testdata
import (
"io/ioutil"
)
func TestErrcheckExclude() []byte {
ret, _ := ioutil.ReadFile("f.txt")
return ret
}
func TestErrcheckNoExclude() []byte {
ret, _ := ioutil.ReadAll(nil) // ERROR "Error return value of `ioutil.ReadAll` is not checked"
return ret
}