Code Room
Code reviewHard
Question
Review this Go enum-serialization change in a public API response.
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 Status int const ( Pending Status = iota // 0 Active // 1 Suspended // 2) func (s Status) MarshalJSON() ([]byte, error) { return json.Marshal(int(s)) // ships status as a number} // New requirement: insert "Trialing" between Pending and Activeconst ( Pending Status = iota // 0 Trialing // 1 <-- inserted Active // 2 Suspended // 3)Run or narrate your approach, then ask the coach.