github.com/chenfeining/golangci-lint@v1.0.2-0.20230730162517-14c6c67868df/test/testdata/errcheck_exclude_functions.go (about)

     1  //golangcitest:args -Eerrcheck
     2  //golangcitest:config_path testdata/configs/exclude_functions.yml
     3  package testdata
     4  
     5  import (
     6  	"io/ioutil"
     7  )
     8  
     9  func TestErrcheckExcludeFunctions() []byte {
    10  	ret, _ := ioutil.ReadFile("f.txt")
    11  	ioutil.ReadDir("dir")
    12  	return ret
    13  }
    14  
    15  func TestErrcheckNoExcludeFunctions() []byte {
    16  	ret, _ := ioutil.ReadAll(nil) // want "Error return value of `ioutil.ReadAll` is not checked"
    17  	return ret
    18  }