A data race happens when two goroutines access the same variable at the same time and at least one writes. The outcome is undefined and often appears only under load. Go ships a detector: run tests or the program with go test -race or go run -race.