1func fetchAll(urls []string) []string {
2 results := make([]string, 0, len(urls))
3 for _, u := range urls {
4 client := &http.Client{}
5 resp, _ := client.Get(u)
6 body, _ := io.ReadAll(resp.Body)
7 results = append(results, string(body))
8 }
9 return results
10}
no lines flagged
#069PracticeMedium18 min · 120 XP
New TCP Connection Opened on Every Request
A high-throughput client exhausts ephemeral ports under load because it never reuses connections.
Flagged linesNo lines flagged yet
What's wrong?
Flag a line or write a note to submit.