Code Room
Code reviewHardcr-g436
Subject Mass assignmentLevel Senior–Staff~22 minCommon in Code quality & review interviewsIndustries Software development

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.

Talk through your review
Code to reviewgo
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.