...

/

Solution: Write Code with WaitGroup

Solution: Write Code with WaitGroup

Check the solution to the challenge of writing code using WaitGroup.

Problem statement

Let’s walk through the solution step by step. Using the http package, we can make the homepage API. Once we hit the API, it will redirect to the homeHandler function. The homeHandler function will create multiple goroutines, and each goroutine will call the fetch function that makes the necessary GET call on the URL and receives the response status.

Let’s look at the handleRequests function. The http package provides the necessary ...