golangci-lint/test/testdata/errcheck_exclude_functions.go
Robert Liebowitz b3f9763246
errcheck: allow exclude config without extra file (#2110)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2021-07-13 02:23:12 +02:00

19 lines
393 B
Go

//args: -Eerrcheck
//config_path: testdata/errcheck/exclude_functions.yml
package testdata
import (
"io/ioutil"
)
func TestErrcheckExcludeFunctions() []byte {
ret, _ := ioutil.ReadFile("f.txt")
ioutil.ReadDir("dir")
return ret
}
func TestErrcheckNoExcludeFunctions() []byte {
ret, _ := ioutil.ReadAll(nil) // ERROR "Error return value of `ioutil.ReadAll` is not checked"
return ret
}