clock
clock copied to clipboard
Correct unit tests and races
- the "too late" go routine did not finish before the end of the function. correct this invalid usage by signalling "too late" using a channel close.
- the read and writes of the 'ok' boolean failed race detection.
avoid ordering issues by using
sync/atomic. - the counters in the examples also suffered from ordering issues. use an atomic for stronger ordering.
This package now passes go test -race.
friendly ping to @andres-erbsen
hi @andres-erbsen, is there something we can do to assist merging this request?