Skip to content

Commit 65e0bfd

Browse files
committed
refactor(handler.go): remove unnecessary sync.WaitGroup usage in handleEvents function to simplify code and improve readability
1 parent bb69ef0 commit 65e0bfd

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

event/handler/handler.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,8 @@ func (h *Handler) Run(ctx context.Context) (<-chan error, error) {
189189

190190
func (h *Handler) handleEvents(ctx context.Context, events <-chan event.Event) <-chan error {
191191
errs, fail := concurrent.Errors(ctx)
192-
var wg sync.WaitGroup
193192
for i := 0; i < h.workers; i++ {
194-
wg.Add(1)
195193
go func() {
196-
defer wg.Done()
197194
for evt := range events {
198195
fn, ok := h.EventHandler(evt.Name())
199196
if !ok {

0 commit comments

Comments
 (0)