Skip to content

Commit 91b20ea

Browse files
blgmonsi
authored andcommitted
chore: fix Go vet issue with Go 1.15
Go vet correctly found issue: Error: gmeasure/experiment.go:474:11: WaitGroup.Add called from inside new goroutine
1 parent 6823587 commit 91b20ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gmeasure/experiment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ func (e *Experiment) Sample(callback func(idx int), samplingConfig SamplingConfi
469469
wg.Wait()
470470
}()
471471
if numParallel > 1 {
472+
wg.Add(numParallel)
472473
for worker := 0; worker < numParallel; worker++ {
473474
go func() {
474-
wg.Add(1)
475475
for idx := range work {
476476
callback(idx)
477477
}

0 commit comments

Comments
 (0)