Code Room
Code reviewMedium
Question
Review this Go HTTP handler exposed at `GET /reports/:id/export`.
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 exportReport(w http.ResponseWriter, r *http.Request) { id := chi.URLParam(r, "id") report := repo.Get(id) file := renderPDF(report) // heavy, ~3s repo.IncrementExportCount(id) // writes to DB audit.Log("export", id) // side effect w.Header().Set("Content-Type", "application/pdf") w.Write(file)}Run or narrate your approach, then ask the coach.