Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kkHAIKE committed Sep 19, 2022
1 parent 2f300bb commit 997f7f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions testdata/src/a/a.go
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 997f7f7

Please sign in to comment.