fr
fr

Question from the Go test

Waiting for validation

Which statements below are true ? (multiple answers)

func main() {
    var count int
	var wg sync.WaitGroup

	for range 1000 {
		wg.Add(1)
		wg.Go(func() {
			defer wg.Done()
			count++
		})
	}

	wg.Wait()
	fmt.Println(count)
}
Author: John PendenqueStatus: Waiting for validationQuestion not yet passed
0
Community EvaluationsNo one has reviewed this question yet, be the first!