Closed kkdai closed 3 years ago
comment written by Square_sun, created at 15 Jul 18 06:06 UTC,
最後的那一段code,wg.Done()不是應該放在for n := range in外面嗎@.@??
comment written by Matt Ho, created at 20 Jul 18 03:33 UTC,
應該是筆誤, 另外 WaitGroup doc 的 example 也建議 wg.Done() 放 defer, 怕那個 for 爆炸沒跑到 done: https://golang.org/pkg/sync...
comment written by Evan Lin, created at 21 Jul 18 07:28 UTC,
感謝兩位提醒...的確是筆誤... 已經修改好了
[Golang] Golang buffered/unbuffer channel and pipeline
http://www.evanlin.com/til-buffered-channel/