Skip to content

Commit a9690fa

Browse files
authored
Enable the fatcontext linter (#822)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
1 parent 15ce6ee commit a9690fa

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ linters:
55
- depguard
66
- errorlint
77
- exptostd
8-
#- fatcontext
8+
- fatcontext
99
#- gocritic
1010
- godot
1111
- govet

route/route.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handl
7878
defer cancel()
7979

8080
for _, p := range params {
81-
ctx = context.WithValue(ctx, param(p.Key), p.Value)
81+
ctx = context.WithValue(ctx, param(p.Key), p.Value) //nolint:fatcontext
8282
}
8383
h(w, req.WithContext(ctx))
8484
}

route/route_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func TestContextWithValue(t *testing.T) {
7171

7272
ctx := r.Context()
7373
for p, v := range params {
74-
ctx = WithParam(ctx, p, v)
74+
ctx = WithParam(ctx, p, v) //nolint:fatcontext
7575
}
7676
r = r.WithContext(ctx)
7777
router.ServeHTTP(nil, r)

0 commit comments

Comments
 (0)