(c cli.Config, numWorkers int)
| 39 | } |
| 40 | |
| 41 | func newContext(c cli.Config, numWorkers int) *context { |
| 42 | ctx := &context{ |
| 43 | c: c, |
| 44 | hosts: make(chan string, numWorkers), |
| 45 | } |
| 46 | ctx.Add(numWorkers) |
| 47 | for i := 0; i < numWorkers; i++ { |
| 48 | go ctx.runWorker() |
| 49 | } |
| 50 | return ctx |
| 51 | } |
| 52 | |
| 53 | func (ctx *context) runWorker() { |
| 54 | for host := range ctx.hosts { |