Code Room
Code reviewHard
Question
Review this Go handler that updates a wallet via JSON.
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 Wallet struct { ID string `json:"id"` Owner string `json:"owner"` Balance float64 `json:"balance"` Label string `json:"label"`} func UpdateWallet(w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["id"] wallet, _ := store.Get(id) if err := json.NewDecoder(r.Body).Decode(&wallet); err != nil { http.Error(w, "bad request", 400) return } store.Save(wallet)}Run or narrate your approach, then ask the coach.