Code Room
Code reviewMediumcr-g592
Subject Http connection leakLevel Mid–Senior~18 minCommon in Networking & APIs interviewsIndustries Software development, Technology

Question

Review this Go HTTP client helper.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewgo
func fetchStatus(url string) (int, error) {	resp, err := http.Get(url)	if err != nil {		return 0, err	}	if resp.StatusCode != 200 {		return resp.StatusCode, fmt.Errorf("bad status")	}	body, _ := io.ReadAll(resp.Body)	resp.Body.Close()	return len(body), nil}
Run or narrate your approach, then ask the coach.