Code Room
Code reviewMedium
Question
Review this Go response type for a document-processing API. A new requirement needs a third state ('partially processed').
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
type DocStatus struct { ID string `json:"id"` Processed bool `json:"processed"` // true = done, false = pending} func getStatus(w http.ResponseWriter, r *http.Request) { d := repo.Get(chi.URLParam(r, "id")) writeJSON(w, 200, DocStatus{ID: d.ID, Processed: d.Done})}Run or narrate your approach, then ask the coach.