From c7e15d664a34b29adeb59a532b1241c8c026603a Mon Sep 17 00:00:00 2001 From: markhughes248 <51246392+markhughes248@users.noreply.github.com> Date: Wed, 5 Feb 2020 14:46:56 -0500 Subject: [PATCH] Update worker-pools.go to print results. Great example but needs one small change to be complete! Print the collected values from the results channel. --- examples/worker-pools/worker-pools.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/worker-pools/worker-pools.go b/examples/worker-pools/worker-pools.go index b3c8892..d51bbef 100644 --- a/examples/worker-pools/worker-pools.go +++ b/examples/worker-pools/worker-pools.go @@ -49,6 +49,6 @@ func main() { // finished. An alternative way to wait for multiple // goroutines is to use a [WaitGroup](waitgroups). for a := 1; a <= numJobs; a++ { - <-results + fmt.Println( <- results ) } }