Refactor context key for logger in main.go
Some checks failed
🏗️✨ Build Workflow / 🖥️ 🔨 Build (push) Has been cancelled
🚨 Test Code Base / 🧹 Lint (push) Has been cancelled
🚨 Test Code Base / 🔍 🐹 Go Tests (push) Has been cancelled

This commit is contained in:
2025-08-27 00:28:36 -04:00
parent ff66877192
commit 2e2f9f7fee

View File

@@ -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)