We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60070fe commit 8574767Copy full SHA for 8574767
internal/cmdtest/test_cmd.go
@@ -55,13 +55,13 @@ type TestCmd struct {
55
Err error
56
}
57
58
-var id int32
+var id atomic.Int32
59
60
// Run exec's the current binary using name as argv[0] which will trigger the
61
// reexec init function for that name (e.g. "geth-test" in cmd/geth/run_test.go)
62
func (tt *TestCmd) Run(name string, args ...string) {
63
- id := atomic.AddInt32(&id, 1)
64
- tt.stderr = &testlogger{t: tt.T, name: fmt.Sprintf("%d", id)}
+ id.Add(1)
+ tt.stderr = &testlogger{t: tt.T, name: fmt.Sprintf("%d", id.Load())}
65
tt.cmd = &exec.Cmd{
66
Path: reexec.Self(),
67
Args: append([]string{name}, args...),
0 commit comments