Waiting for validation
Which statements are true? (multiple answers)
func fetch(ctx context.Context, i int) error {
return fmt.Errorf("error from goroutine %d", i)
}
func main() {
g, _ := errgroup.WithContext(context.Background())
for i := range 1000 {
g.Go(func() error {
return fetch(context.Background(), i)
})
}
err := g.Wait()
if err != nil {
fmt.Println(err)
}
}
Author: John PendenqueStatus: Waiting for validationQuestion not yet passed
0
Community EvaluationsNo one has reviewed this question yet, be the first!
0
How to use goroutines in Go0
Write a Go program that prints the string "Hello World" to the console.0
Write a Go program that prints the following lines to the console: line 1, line 2, line 3, line 40
Write a Go program that prints the numbers from 1 to 101
Iterate over a slice in Go2
What is the equivalent of undefined in Go?5
Write a Go program that prints 1 if test is true, and 0 otherwise.