Revert "internal: use atomic type (#27858)"

This reverts commit f7b3aedcb5.
This commit is contained in:
devopsbo3 2023-11-10 12:27:53 -06:00 committed by GitHub
parent 3dc06db5af
commit 3180bf2316

View file

@ -55,13 +55,13 @@ type TestCmd struct {
Err error Err error
} }
var id atomic.Int32 var id int32
// Run exec's the current binary using name as argv[0] which will trigger the // Run exec's the current binary using name as argv[0] which will trigger the
// reexec init function for that name (e.g. "geth-test" in cmd/geth/run_test.go) // reexec init function for that name (e.g. "geth-test" in cmd/geth/run_test.go)
func (tt *TestCmd) Run(name string, args ...string) { func (tt *TestCmd) Run(name string, args ...string) {
id.Add(1) id := atomic.AddInt32(&id, 1)
tt.stderr = &testlogger{t: tt.T, name: fmt.Sprintf("%d", id.Load())} tt.stderr = &testlogger{t: tt.T, name: fmt.Sprintf("%d", id)}
tt.cmd = &exec.Cmd{ tt.cmd = &exec.Cmd{
Path: reexec.Self(), Path: reexec.Self(),
Args: append([]string{name}, args...), Args: append([]string{name}, args...),