Code Room
Code reviewMedium
Question
Review this Go code that decodes a timestamp field from an incoming event and stores it.
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 Event struct { TS int64 `json:"ts"` // producer A sends seconds; producer B sends milliseconds} func decode(b []byte) (time.Time, error) { var e Event if err := json.Unmarshal(b, &e); err != nil { return time.Time{}, err } return time.Unix(e.TS, 0), nil // store as time}Run or narrate your approach, then ask the coach.