aboutsummaryrefslogtreecommitdiff
path: root/src/testing/fuzz.go
diff options
context:
space:
mode:
authorcuiweixie <cuiweixie@gmail.com>2022-08-27 10:24:49 +0800
committerGopher Robot <gobot@golang.org>2022-08-29 14:52:44 +0000
commita1c9783ca1a98eef0fbfa46f8027e711b471b600 (patch)
treea01a68706711c18581ea9a4c6dc52e9a0cc001a4 /src/testing/fuzz.go
parent863d57cc7df5b1604d501892b7293efe0fa7e690 (diff)
downloadgo-a1c9783ca1a98eef0fbfa46f8027e711b471b600.tar.xz
testing: convert numFailed to atomic type
Change-Id: Ic3464e95ad8901df5477d7717760b8c6d08ce97b Reviewed-on: https://go-review.googlesource.com/c/go/+/426078 Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/testing/fuzz.go')
-rw-r--r--src/testing/fuzz.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go
index b9f3a3d159..e60ecadf25 100644
--- a/src/testing/fuzz.go
+++ b/src/testing/fuzz.go
@@ -14,7 +14,6 @@ import (
"path/filepath"
"reflect"
"runtime"
- "sync/atomic"
"time"
)
@@ -615,7 +614,7 @@ func fRunner(f *F, fn func(*F)) {
// the original panic should still be
// clear.
if f.Failed() {
- atomic.AddUint32(&numFailed, 1)
+ numFailed.Add(1)
}
err := recover()
if err == nil {