go concurrent execution of f with parameter i. Tasks are independent and don't return any value. code example
Example: go concurrent execution of f with parameter i. Tasks are independent and don't return any value.
wg := sync.WaitGroup{}
wg.Add(1000)
for i := 1; i <= 1000; i++ {
go func(j int) {
f(j)
wg.Done()
}(i)
}
wg.Wait()