internal/socket, webdav: use testing.T.TempDir

It's available since Go 1.15 and go.mod currently specifies Go 1.18.

Change-Id: Ia5ba22f5802f4af9fb6d3b6e7ee5a02ce3582e9a
Reviewed-on: https://go-review.googlesource.com/c/net/+/643595
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Tobias Klauser
2025-01-21 11:49:39 +01:00
committed by Gopher Robot
parent 56691ee141
commit 45432b5e4f
2 changed files with 2 additions and 11 deletions

View File

@@ -445,11 +445,7 @@ func main() {
if runtime.Compiler == "gccgo" {
t.Skip("skipping race test when built with gccgo")
}
dir, err := os.MkdirTemp("", "testrace")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
defer os.RemoveAll(dir)
dir := t.TempDir()
goBinary := filepath.Join(runtime.GOROOT(), "bin", "go")
t.Logf("%s version", goBinary)
got, err := exec.Command(goBinary, "version").CombinedOutput()

View File

@@ -517,12 +517,7 @@ func TestDir(t *testing.T) {
t.Skip("see golang.org/issue/11453")
}
td, err := os.MkdirTemp("", "webdav-test")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(td)
testFS(t, Dir(td))
testFS(t, Dir(t.TempDir()))
}
func TestMemFS(t *testing.T) {