diff --git a/sync_consumer.go b/sync_consumer.go index 0d14c38..86ef025 100644 --- a/sync_consumer.go +++ b/sync_consumer.go @@ -82,7 +82,8 @@ func (t *SyncEventConsumer) consumeEvent(ctx Context) (*Event, error) { func SyncHandlers[T Context](fn ...func(ctx T, e Event) error) []SyncEventHandlerFunc { var syncHandlers []SyncEventHandlerFunc - for _, f := range fn { + for i := range fn { + f := fn[i] syncHandler := func(ctx Context, e Event) error { return f(ctx.(T), e) }