Update examples/waitgroup/waitgroup.go
Co-Authored-By: Mark McGranaghan <mmcgrana@gmail.com>
This commit is contained in:
parent
2967315795
commit
c7dd69349b
@ -19,7 +19,7 @@ func worker(id int, wg *sync.WaitGroup) {
|
|||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
fmt.Printf("Worker %d done\n", id)
|
fmt.Printf("Worker %d done\n", id)
|
||||||
|
|
||||||
// Notify the WaitGroup that we're done.
|
// Notify the WaitGroup that this worker is done.
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user