ws-examples
ws-examples copied to clipboard
Find task in pool question
Hi , I read this part fo code func (p *Pool) worker(task func()) { defer func() { <-p.sem }()
**task()**
**for task := range p.work {
**task()**
}**
} question :
- why not just use range p.work do task() ?
- Do task() before that("range p.work") is essential? Thank you