I'm looking at the goroutines blog post about patterns with goroutines and channels etc.
In the bounded.go example I see this:
paths, errc := walkFiles(done, root)
// Start a fixed number of goroutines to read and digest files.
c := make(chan result) // HLc
var wg sync.WaitGroup
const numDigesters = 20
wg.Add(numDigesters)
for i := 0; i < numDigesters; i++ {
go func() {
digester(done, paths, c) // HLc
wg.Done()
}()
}
Now since each digester is processing the same paths
collection, why doesn't it repeat the same file twice?