diff options
| author | Alex Brainman <alex.brainman@gmail.com> | 2019-02-28 20:20:40 +1100 |
|---|---|---|
| committer | Alex Brainman <alex.brainman@gmail.com> | 2019-03-01 07:45:00 +0000 |
| commit | 44d3bb998ca00e49d9e0138954287af206b614bf (patch) | |
| tree | 626072555a4b773c19241b60ad7d05b3d5999e8a /src/path/filepath/path_test.go | |
| parent | 2edd559223f3b3fd54e354c9a9703248a935c91a (diff) | |
| download | go-44d3bb998ca00e49d9e0138954287af206b614bf.tar.xz | |
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 <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/path/filepath/path_test.go')
| -rw-r--r-- | src/path/filepath/path_test.go | 10 |
1 files changed, 0 insertions, 10 deletions
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 { |
