mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <iant@golang.org> Trust: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
parent
cccd3ba912
commit
c27991bf5b
1 changed files with 1 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue