github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/staticcheck/testdata/src/checkStdlibUsageNilContext/checkStdlibUsageNilContext.go (about)

     1  package pkg
     2  
     3  import "context"
     4  
     5  func fn1(ctx context.Context)           {}
     6  func fn2(x string, ctx context.Context) {}
     7  
     8  func fn3() {
     9  	fn1(nil) // MATCH /do not pass a nil Context/
    10  	fn1(context.TODO())
    11  	fn2("", nil)
    12  }