gitee.com/mirrors/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/staticcheck/testdata/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 }