From 433700d5451c2c96b3c27313f1f75e2b03b9fa92 Mon Sep 17 00:00:00 2001 From: RubenPari Date: Sun, 9 Aug 2026 22:38:12 +0200 Subject: [PATCH] test(context): use named context key in multipart cleanup test staticcheck SA1029 forbids empty anonymous struct as context.WithValue keys; use a local named type instead. --- context_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/context_test.go b/context_test.go index 449bc4aa..43e1d263 100644 --- a/context_test.go +++ b/context_test.go @@ -302,8 +302,10 @@ func TestServeHTTPCleansMultipartFormAfterWithContext(t *testing.T) { router := New() router.MaxMultipartMemory = 32 // force temp file + // Named key type required by staticcheck SA1029 (avoid empty anonymous struct keys). + type withContextMarker struct{} router.Use(func(c *Context) { - c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), struct{}{}, 1)) + c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), withContextMarker{}, 1)) c.Next() })