Code Room
Code reviewHard
Question
Review this Go read-through cache.
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
func GetUser(id string) (*User, error) { if u, ok := cache.Get(id); ok { return u.(*User), nil } u, err := db.LoadUser(id) if err != nil { return nil, err } cache.Set(id, u, 5*time.Minute) return u, nil}Run or narrate your approach, then ask the coach.