From 997f7f77ca6d287be075a84256b9cb7ef10faec1 Mon Sep 17 00:00:00 2001 From: kkHAIKE Date: Mon, 19 Sep 2022 20:20:24 +0800 Subject: [PATCH] fix test --- testdata/src/a/a.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)