1
0
mirror of https://github.com/golang/go synced 2024-11-25 20:47:58 -07:00

cmd/cgo/internal/testsanitizers: use t.TempDir

Change-Id: I6b2c25ab045aaec8bb6c25511b12d178d155fc25
Reviewed-on: https://go-review.googlesource.com/c/go/+/630338
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2024-11-20 14:21:33 -08:00 committed by Gopher Robot
parent f96987888f
commit a9428eab40

View File

@ -563,12 +563,7 @@ func (d *tempDir) Join(name string) string {
} }
func newTempDir(t *testing.T) *tempDir { func newTempDir(t *testing.T) *tempDir {
t.Helper() return &tempDir{base: t.TempDir()}
dir, err := os.MkdirTemp("", filepath.Dir(t.Name()))
if err != nil {
t.Fatalf("Failed to create temp dir: %v", err)
}
return &tempDir{base: dir}
} }
// hangProneCmd returns an exec.Cmd for a command that is likely to hang. // hangProneCmd returns an exec.Cmd for a command that is likely to hang.