Code Room
Code reviewHard
Question
Review this Go helper that races a primary and a fallback backend and returns whichever answers first.
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 Query(ctx context.Context, primary, fallback Backend) (Result, error) { ch := make(chan Result) go func() { ch <- primary.Do(ctx) }() go func() { ch <- fallback.Do(ctx) }() select { case r := <-ch: return r, nil case <-ctx.Done(): return Result{}, ctx.Err() }}Run or narrate your approach, then ask the coach.