Code Room
Code reviewHard
Question
Review this Go change that adds a new field to a create-request struct for an existing v1 endpoint.
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 CreateInvoiceReq struct { CustomerID string `json:"customer_id"` Amount int64 `json:"amount"` Currency string `json:"currency"`} func createInvoice(w http.ResponseWriter, r *http.Request) { var req CreateInvoiceReq json.NewDecoder(r.Body).Decode(&req) if req.Currency == "" { http.Error(w, "currency is required", 400) // newly added check } inv := invoices.Create(req.CustomerID, req.Amount, req.Currency) writeJSON(w, 201, inv)}Run or narrate your approach, then ask the coach.