Code Room
Code reviewMedium
Question
Review this Go session store. `Touch` refreshes a session's TTL under a write lock.
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 (s *Store) Touch(id string) error { s.mu.RLock() sess, ok := s.m[id] if !ok { return ErrNotFound // early return } s.mu.RUnlock() s.mu.Lock() sess.expires = time.Now().Add(ttl) s.mu.Unlock() return nil}Run or narrate your approach, then ask the coach.