Data race

A data race occurs when multiple goroutines access the same memory location concurrently, at least one access is a write, and the accesses are not properly synchronized. Data races can cause unpredictable behavior and are not made safe merely by running tests repeatedly.

Learn this concept

Lesson 1.13 · Goroutines, WaitGroup and the race detector

Used in exercises

Exercise 1.14 · Limiter interface and a FixedWindow implementation Exercise 1.15 · Table-driven tests with a fake clock, plus one race test Exercise 2.17 · GET /v1/restaurants: open status Exercise 5.13 · Hub broadcast and claim race tests Exercise 6.15 · Runtime feature switches Exercise 8.4 · Payment processing service
Prerequisite conceptsGoroutinesMutex