Skip to content

Commit

Permalink
fix: loop var in SyncHandlers (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored Feb 8, 2024
1 parent 33b24a2 commit 899edea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sync_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 899edea

Please sign in to comment.