I tried making a go program that has two routines runnig that writes to and read from a variable . The writes and read were protected by locks ,but since locks does not guarantee order of execution data race could happen . The race detector is not detecting that
This is not a data race, this is a high-level logical race. The race detector detects only data races.
Most logical races are intentional and it is not possible to distinguish between intentional and harmful unintentional races.