blob: d65fb5e8e2e909b69a37a37e2780f9e8154a1152 [file] [log] [blame]
// +build ignore,OMIT
package main
import (
"fmt"
"sync"
)
func main() {
const workers = 100 // what if we have 1, 2, 25?
var wg sync.WaitGroup
wg.Add(workers)
m := map[int]int{}
for i := 1; i <= workers; i++ {
go func(i int) {
for j := 0; j < i; j++ {
m[i]++ // HL
}
wg.Done()
}(i)
}
wg.Wait()
fmt.Println(m)
}