Update examples/waitgroup/waitgroup.go

Co-Authored-By: Mark McGranaghan <mmcgrana@gmail.com>
This commit is contained in:
Eli Bendersky 2019-05-30 05:54:32 -07:00 committed by GitHub
parent 2967315795
commit c7dd69349b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
} }