-
Notifications
You must be signed in to change notification settings - Fork 304
Open
Labels
rule proposalIssue proposing a new ruleIssue proposing a new rule
Description
Go 1.25 adds the method func (wg *WaitGroup) Go(f func())
This method allows rewriting code like
wg.Add(1)
go func() {
defer wg.Done()
doSomething()
}()
into
wg.Go(func() {
doSomething()
})
revive could spot code fragments where the new method can be used to replace the more verbose (and sometimes fragile) legacy idiom.
rule name: use-wg-go
(or use-waitgroup-go
)
A prototype implementation of the rule can be found at the sandbox
branch
(the rulename in the branch is deleteme
)
You can run the rule with revive -config deleteme.toml ./...
ccoVeille
Metadata
Metadata
Assignees
Labels
rule proposalIssue proposing a new ruleIssue proposing a new rule