Code Room
Code reviewHard
Question
Review this Go webhook-delivery worker.
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.
Learn the concepts
func deliverWebhook(endpoint string, payload []byte) error { parsed, err := url.Parse(endpoint) if err != nil { return err } if parsed.Hostname() == "localhost" || parsed.Hostname() == "127.0.0.1" { return errors.New("blocked") } resp, err := http.Post(endpoint, "application/json", bytes.NewReader(payload)) if err != nil { return err } defer resp.Body.Close() return nil}Run or narrate your approach, then ask the coach.