mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
archive/tar: replace os.MkdirTemp with T.TempDir
Updates #45402 Change-Id: I296f8c676c68ed1e10b6ad1a17b5b23d2c395252 Reviewed-on: https://go-review.googlesource.com/c/go/+/309355 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
3bf645a633
commit
069983e5db
1 changed files with 2 additions and 7 deletions
|
|
@ -262,16 +262,11 @@ func TestFileInfoHeaderDir(t *testing.T) {
|
||||||
func TestFileInfoHeaderSymlink(t *testing.T) {
|
func TestFileInfoHeaderSymlink(t *testing.T) {
|
||||||
testenv.MustHaveSymlink(t)
|
testenv.MustHaveSymlink(t)
|
||||||
|
|
||||||
tmpdir, err := os.MkdirTemp("", "TestFileInfoHeaderSymlink")
|
tmpdir := t.TempDir()
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(tmpdir)
|
|
||||||
|
|
||||||
link := filepath.Join(tmpdir, "link")
|
link := filepath.Join(tmpdir, "link")
|
||||||
target := tmpdir
|
target := tmpdir
|
||||||
err = os.Symlink(target, link)
|
if err := os.Symlink(target, link); err != nil {
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
fi, err := os.Lstat(link)
|
fi, err := os.Lstat(link)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue