From 43f77bed239d25b0137e99b96f0ca4fd2b78002a Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Thu, 15 Jan 2026 11:50:43 +0300 Subject: [PATCH] add validate subscriber signature func --- server/noop.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/noop.go b/server/noop.go index bd05f52d..cb7d5e42 100644 --- a/server/noop.go +++ b/server/noop.go @@ -534,6 +534,10 @@ func newSubscriber(topic string, sub interface{}, opts ...SubscriberOption) Subs h.reqType = typ.In(1) } + if h.reqType.Kind() == reflect.Interface { + panic(fmt.Sprintf("subscriber for %s: request type cannot be interface{} or any", topic)) + } + handlers = append(handlers, h) } else { for m := 0; m < typ.NumMethod(); m++ { @@ -550,6 +554,10 @@ func newSubscriber(topic string, sub interface{}, opts ...SubscriberOption) Subs h.reqType = method.Type.In(2) } + if h.reqType.Kind() == reflect.Interface { + panic(fmt.Sprintf("subscriber for %s: request type cannot be interface{} or any", topic)) + } + handlers = append(handlers, h) } }