From 2e2f9f7fee9a0b56bce042ebee1bcf0f0587ad75 Mon Sep 17 00:00:00 2001 From: Ron Rise Date: Wed, 27 Aug 2025 00:28:36 -0400 Subject: [PATCH] Refactor context key for logger in main.go --- main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 2b27b90..f5a9b2b 100644 --- a/main.go +++ b/main.go @@ -14,10 +14,6 @@ import ( "github.com/siteworxpro/top-wallpaper/redis" ) -type contextKey string - -const ContextKeyLogger contextKey = "logger" - func main() { ctx, fn := context.WithCancel(context.Background()) @@ -61,7 +57,8 @@ func main() { } ctx = redis.WithContext(ctx, rc) - ctx = context.WithValue(ctx, ContextKeyLogger, e.Logger) + + ctx = context.WithValue(ctx, "logger", e.Logger) //nolint:staticcheck go reddit.Fetch(ctx)