aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 02b2d730eb..93297b2dca 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -697,8 +697,7 @@ func tRunner(t *T, fn func(t *T)) {
// a call to runtime.Goexit, record the duration and send
// a signal saying that the test is done.
defer func() {
- t.raceErrors += race.Errors()
- if t.raceErrors > 0 {
+ if t.raceErrors+race.Errors() > 0 {
t.Errorf("race detected during execution of test")
}