Skip to content

Use sync.WaitGroup.Go for goroutine fan-out - #8

Merged
ChristopherLiew merged 1 commit into
mainfrom
refactor/daemon-waitgroup-go
Nov 16, 2026
Merged

ChristopherLiew merged 1 commit into
mainfrom
refactor/daemon-waitgroup-go

Conversation

@ChristopherLiew

Copy link
Copy Markdown
Owner

Replace the wg.Add/go/defer wg.Done pattern with WaitGroup.Go (Go 1.25+) in the daemon accept loop and the two concurrency tests, and switch those tests to range-over-int loops. TestConcurrentClaimsOneGrant now records each response in its own slot and counts grants with gslice.CountBy, dropping the mutex and shared counter.

No behaviour change.

Replace the wg.Add/go/defer wg.Done pattern with WaitGroup.Go (Go 1.25+)
in the daemon accept loop and the two concurrency tests, and switch those
tests to range-over-int loops. TestConcurrentClaimsOneGrant now records
each response in its own slot and counts grants with gslice.CountBy,
dropping the mutex and shared counter.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChristopherLiew
ChristopherLiew merged commit c2973f5 into main Nov 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant