Skip to content

Conversation

@jabr
Copy link
Contributor

@jabr jabr commented Dec 17, 2025

Small refactor cleanup suggested by Go modernizer: https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize#hdr-Analyzer_waitgroup

It replaces the common pattern

wg.Add(1)
go func() {
	defer wg.Done()
	...
}()

with a single call to

wg.Go(func(){ ... })

@jabr jabr changed the title refactor: use WaitGroup.Go to replace wg.Add(1)/go/wg.Done() boilerplate refactor: use WaitGroup#Go to replace wg.Add(1)/go/wg.Done() boilerplate Dec 17, 2025
Copy link
Owner

@psviderski psviderski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@psviderski psviderski merged commit 65e9cdd into psviderski:main Dec 19, 2025
4 checks passed
@jabr jabr deleted the modernize-waitgroup branch December 20, 2025 06:36
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.

2 participants