aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2024-09-04 17:31:56 -0700
committerGopher Robot <gobot@golang.org>2024-09-06 13:23:10 +0000
commit86d74894cc5f5bc6e814fecfa0300cd1c0fd06e4 (patch)
tree145fdfeae1da625dbec25437c1c6e9865b50a665 /src/os
parent6cb8e5ca9fabc1791e0db9d71548bd71f08f3585 (diff)
downloadgo-86d74894cc5f5bc6e814fecfa0300cd1c0fd06e4.tar.xz
os: use Mkdir in TestCopyFSWithSymlinks
This code creates a few directories under a temporary directory that was just created before, so using MkdirTemp is not needed here. Change-Id: Icfc45b70349bc1927efb1647bcc9fd58aa82b792 Reviewed-on: https://go-review.googlesource.com/c/go/+/611037 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/os_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/os/os_test.go b/src/os/os_test.go
index 9f6f531288..6a92132845 100644
--- a/src/os/os_test.go
+++ b/src/os/os_test.go
@@ -3404,9 +3404,9 @@ func TestCopyFSWithSymlinks(t *testing.T) {
// Create a directory and file outside.
tmpDir := t.TempDir()
- outsideDir, err := MkdirTemp(tmpDir, "copyfs_out_")
- if err != nil {
- t.Fatalf("MkdirTemp: %v", err)
+ outsideDir := filepath.Join(tmpDir, "copyfs_out")
+ if err := Mkdir(outsideDir, 0755); err != nil {
+ t.Fatalf("Mkdir: %v", err)
}
outsideFile := filepath.Join(outsideDir, "file.out.txt")
@@ -3415,9 +3415,9 @@ func TestCopyFSWithSymlinks(t *testing.T) {
}
// Create a directory and file inside.
- insideDir, err := MkdirTemp(tmpDir, "copyfs_in_")
- if err != nil {
- t.Fatalf("MkdirTemp: %v", err)
+ insideDir := filepath.Join(tmpDir, "copyfs_in")
+ if err := Mkdir(insideDir, 0755); err != nil {
+ t.Fatalf("Mkdir: %v", err)
}
insideFile := filepath.Join(insideDir, "file.in.txt")
if err := WriteFile(insideFile, []byte("Testing CopyFS inside"), 0644); err != nil {
@@ -3463,9 +3463,9 @@ func TestCopyFSWithSymlinks(t *testing.T) {
// Copy the directory tree and verify.
forceMFTUpdateOnWindows(t, insideDir)
fsys := DirFS(insideDir)
- tmpDupDir, err := MkdirTemp(tmpDir, "copyfs_dup_")
- if err != nil {
- t.Fatalf("MkdirTemp: %v", err)
+ tmpDupDir := filepath.Join(tmpDir, "copyfs_dup")
+ if err := Mkdir(tmpDupDir, 0755); err != nil {
+ t.Fatalf("Mkdir: %v", err)
}
// TODO(panjf2000): symlinks are currently not supported, and a specific error