fr
fr

Question from the Go test

Waiting for validation

What can we expect when running the code below?

func main() {
	var wg sync.WaitGroup

	for i := range 3 {
		wg.Add(1)
		wg.Go(func() {
			defer wg.Done()
			fmt.Println(i)
		})
	}

	wg.Wait()
}

Author: John PendenqueStatus: Waiting for validationQuestion not yet passed
0
Community EvaluationsNo one has reviewed this question yet, be the first!