Go’s race detector cannot prove a concurrent operation is correct
Anton Zhiyanov’s Go concurrency guide separates data races from race conditions. Individually synchronized balance reads and writes can still produce an incorrect withdrawal when the whole check-and-update sequence is not protected. The examples show why a clean race-detector run is insufficient, and how locking the composite operation preserves the application’s intended rule.
Anton Zhiyanov · Sep 26, 2026
Why it matters
This is a useful debugging distinction when concurrent code passes tooling checks but produces wrong results.
More context
Read the Data races and Race conditions sections, then inspect one compound operation in your service. The free guide also covers channels, cancellation and testing; this card focuses on the race examples.
Keep in mind
This is an educational explanation, not a new Go release. 1min read the examples but did not execute them; locking strategy must fit the application’s full invariants.
Original read