From c27991bf5b5a0c8b7383650309d10913eb0497c4 Mon Sep 17 00:00:00 2001 From: Manlio Perillo Date: Mon, 12 Apr 2021 22:24:01 +0200 Subject: [PATCH] text/template: replace os.MkdirTemp with T.TempDir Updates #45402 Change-Id: I9d55191c4021387b771550b5c93c91806f694aa6 Reviewed-on: https://go-review.googlesource.com/c/go/+/309351 Reviewed-by: Ian Lance Taylor Trust: Tobias Klauser --- src/text/template/link_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/text/template/link_test.go b/src/text/template/link_test.go index 9dc70dfc0da..e1d3136abe7 100644 --- a/src/text/template/link_test.go +++ b/src/text/template/link_test.go @@ -39,11 +39,7 @@ func main() { t.Used() } ` - td, err := os.MkdirTemp("", "text_template_TestDeadCodeElimination") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(td) + td := t.TempDir() if err := os.WriteFile(filepath.Join(td, "x.go"), []byte(prog), 0644); err != nil { t.Fatal(err)