-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Description
Just wondering, for Goal #1 in Readme, the 2nd approach seems to remove the required modification in startTheThing which receives conc.WaitGroup as function parameter, would that make it look simpler for adopting conc lib?
I misunderstood it on the first glance.
- 1st (original one)
func main() {
var wg conc.WaitGroup
defer wg.Wait()
startTheThing(&wg)
}
func startTheThing(wg *conc.WaitGroup) {
wg.Go(func() { ... })
}
- 2nd
func main() {
var wg conc.WaitGroup
defer wg.Wait()
func(wg *conc.WaitGroup) {
wg.Go(startTheThing(...))
}(&wg)
}
func startTheThing() {
...
}
Metadata
Metadata
Assignees
Labels
No labels