Skip to content
Snippets Groups Projects
Commit 8f198da2 authored by Wolfgang Welz's avatar Wolfgang Welz
Browse files

Fix: do not capture loop variable

parent af1fee98
No related branches found
No related tags found
No related merge requests found
...@@ -15,11 +15,11 @@ func Benchmark(b *testing.B) { ...@@ -15,11 +15,11 @@ func Benchmark(b *testing.B) {
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
wg.Add(1) wg.Add(1)
go func() { go func(i int) {
<-pool.Submit(i) <-pool.Submit(i)
wg.Done() wg.Done()
}() }(i)
} }
wg.Wait() wg.Wait()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment