diff --git a/testdata/src/a/a.go b/testdata/src/a/a.go index f8f5dbb..9d5552b 100644 --- a/testdata/src/a/a.go +++ b/testdata/src/a/a.go @@ -104,9 +104,10 @@ func f9(w http.ResponseWriter, r *http.Request) { f8(context.Background(), w, r) // want "Non-inherited new context, use function like `context.WithXXX` or `r.Context` instead" } +// auto mark r as server-side request func f10(in bool, w http.ResponseWriter, r *http.Request) { f8(r.Context(), w, r) - f8(context.Background(), w, r) + f8(context.Background(), w, r) // want "Non-inherited new context, use function like `context.WithXXX` or `r.Context` instead" } // nolint: contextcheck @@ -126,8 +127,7 @@ func f11() { f9(w, r) - // f10 should be like `func f10(ctx context.Context, in bool, w http.ResponseWriter, r *http.Request)` - f10(true, w, r) // want "Function `f10` should pass the context parameter" + f10(true, w, r) f14(w, r, nil) f15(w, r, nil)