From 2316cd619866eae0a66dd17b859ca09ae2cd89f7 Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Tue, 26 Aug 2025 17:18:43 +0200 Subject: [PATCH] Enable the fatcontext linter Signed-off-by: Arve Knudsen --- .golangci.yml | 2 +- route/route.go | 2 +- route/route_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f22a4bcdf..e356ae060 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ linters: - depguard - errorlint - exptostd - #- fatcontext + - fatcontext #- gocritic #- godot - govet diff --git a/route/route.go b/route/route.go index e89fe7ebc..18039fac0 100644 --- a/route/route.go +++ b/route/route.go @@ -78,7 +78,7 @@ func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handl defer cancel() for _, p := range params { - ctx = context.WithValue(ctx, param(p.Key), p.Value) + ctx = context.WithValue(ctx, param(p.Key), p.Value) //nolint:fatcontext } h(w, req.WithContext(ctx)) } diff --git a/route/route_test.go b/route/route_test.go index 87c32efd1..cc1b178cd 100644 --- a/route/route_test.go +++ b/route/route_test.go @@ -71,7 +71,7 @@ func TestContextWithValue(t *testing.T) { ctx := r.Context() for p, v := range params { - ctx = WithParam(ctx, p, v) + ctx = WithParam(ctx, p, v) //nolint:fatcontext } r = r.WithContext(ctx) router.ServeHTTP(nil, r)