
* Renamed the example * Reworded comments * Moved it to after worker pools * Sleep for a second instead of random * Mention the new sample in worker pools
15 lines
281 B
Bash
15 lines
281 B
Bash
$ go run waitgroup.go
|
|
Worker 5 starting
|
|
Worker 3 starting
|
|
Worker 4 starting
|
|
Worker 1 starting
|
|
Worker 2 starting
|
|
Worker 4 done
|
|
Worker 1 done
|
|
Worker 2 done
|
|
Worker 5 done
|
|
Worker 3 done
|
|
|
|
# The order of workers starting up and finishing
|
|
# is likely to be different for each invocation.
|