A simple demonstration of the perils of using -cover and -race together
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
coverrace.go
coverrace_test.go

README.md

CoverRace

This is a simple demonstration of the perils of running go test -cover -race, i.e. the Go cover tool with the Go race detector at the same time. The lesson is to always also add the -covermode=atomic flag, like this: go test -cover -covermode=atomic -race.

For a full explanation, refer to the blog post on http://herman.asia