From 44d3bb998ca00e49d9e0138954287af206b614bf Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Thu, 28 Feb 2019 20:20:40 +1100 Subject: path/filepath: do not call GetFinalPathNameByHandle from EvalSymlinks EvalSymlinks is using GetFinalPathNameByHandle to handle symlinks with unusual targets like \??\Volume{ABCD}\. But since CL 164201, os.Readlink handles path like that too. So remove all that extra code that EvalSymlinks calls when os.Readlink fails - it is not needed any more. Now that windows EvalSymlinks implementation is similar to unix implementation, we can remove all slashAfterFilePathError related code too. So do that. This also makes TestIssue29372 pass even when TMP directory refers to symlinks with target like \??\Volume{ABCD}\. So remove TestIssue29372 code that helped it pass on windows-arm. TestIssue29372 should pass as is now. Fixes #29746 Change-Id: I568d142c89d3297bff8513069bceaa6be51fe7e4 Reviewed-on: https://go-review.googlesource.com/c/164202 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/path/filepath/path_test.go | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/path/filepath/path_test.go') diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go index 7a434a4292..709dccb61b 100644 --- a/src/path/filepath/path_test.go +++ b/src/path/filepath/path_test.go @@ -1377,16 +1377,6 @@ func TestIssue29372(t *testing.T) { } defer os.RemoveAll(tmpDir) - if runtime.GOOS == "windows" { - // This test is broken on windows, if temporary directory - // is a symlink. See issue 29746. - // TODO(brainman): Remove this hack once issue #29746 is fixed. - tmpDir, err = filepath.EvalSymlinks(tmpDir) - if err != nil { - t.Fatal(err) - } - } - path := filepath.Join(tmpDir, "file.txt") err = ioutil.WriteFile(path, nil, 0644) if err != nil { -- cgit v1.3