From cfdf589f43c9d7cb59359ce7f14ebf84e04fd6e5 Mon Sep 17 00:00:00 2001 From: MohitKatare-protean Date: Wed, 9 Apr 2025 08:25:05 +0530 Subject: [PATCH] Resolved linitng issue --- core/module/module.go | 2 +- core/module/module_test.go | 2 +- pkg/model/model.go | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/module/module.go b/core/module/module.go index 4641fcb..2a28e62 100644 --- a/core/module/module.go +++ b/core/module/module.go @@ -76,7 +76,7 @@ func addMiddleware(ctx context.Context, mgr handler.PluginManager, handler http. func moduleCtxMiddleware(moduleName string, next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := context.WithValue(r.Context(), model.ContextKeyModuleId, moduleName) + ctx := context.WithValue(r.Context(), model.ContextKeyModuleID, moduleName) next.ServeHTTP(w, r.WithContext(ctx)) }) } diff --git a/core/module/module_test.go b/core/module/module_test.go index 6091fc1..ffeaafe 100644 --- a/core/module/module_test.go +++ b/core/module/module_test.go @@ -107,7 +107,7 @@ func TestRegisterSuccess(t *testing.T) { // Create a handler that extracts context var capturedModuleName any testHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - capturedModuleName = r.Context().Value(model.ContextKeyModuleId) + capturedModuleName = r.Context().Value(model.ContextKeyModuleID) w.WriteHeader(http.StatusOK) }) diff --git a/pkg/model/model.go b/pkg/model/model.go index 1193dee..a91e2a3 100644 --- a/pkg/model/model.go +++ b/pkg/model/model.go @@ -16,10 +16,6 @@ type Subscriber struct { Domain string `json:"domain"` } -type ContextKey string - -const ContextKeyModuleId ContextKey = "module_id" - // Subscription represents subscription details of a network participant. type Subscription struct { Subscriber `json:",inline"`