SO golang example with infinite for / channel workers
You wrote:
func doStuff(datachan &lt;-chan map[string]string, reschan chan&lt;- int) {
    for {
        data, ok := &lt;-datachan
        if !ok {
            log.Print(&quot;Channel closed.&quot;)
            break
        }
        log.Printf(&quot;Data had %d length: %+v&quot;, len(data), data)
        reschan &lt;- len(data)
    }
    return
}

I don't understand why you didn't write:
func doStuff(datachan &lt;-chan map[string]string, reschan chan&lt;- int) {
    for data := range datachan {
        log.Printf(&quot;Data had %d length: %+v&quot;, len(data), data)
        reschan &lt;- len(data)
    }
    log.Print(&quot;Channel closed.&quot;)
}