]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "os: handle long path in RemoveAll for windows"
authorIan Lance Taylor <iant@golang.org>
Mon, 13 Jan 2020 23:34:53 +0000 (23:34 +0000)
committerIan Lance Taylor <iant@golang.org>
Mon, 13 Jan 2020 23:35:18 +0000 (23:35 +0000)
This reverts CL 214437.

Does not fix the issue, and the test was wrong so it did not detect that it did not fix the issue.

Updates #36375

Change-Id: I6a4112035a1e90f4fdafed6fdf4ec9dfc718b571
Reviewed-on: https://go-review.googlesource.com/c/go/+/214601
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/removeall_noat.go
src/os/removeall_test.go

index 6474d2d54e4dfed005bb21b3bb5f3bbaa78d6915..c1b43e380753e6ea748ade2803fb346688d0f2f8 100644 (file)
@@ -27,7 +27,6 @@ func removeAll(path string) error {
        }
 
        // Simple case: if Remove works, we're done.
-       path = fixLongPath(path)
        err := Remove(path)
        if err == nil || IsNotExist(err) {
                return nil
index 6fb31c2d8f1ef77c0ff36b7bcbde49f8c941cb5c..8a71f687ed0d7ccfe30885c33fe2eb97e81d2d02 100644 (file)
@@ -206,26 +206,6 @@ func TestRemoveAllLongPath(t *testing.T) {
        }
 }
 
-func TestRemoveAllLongPathWindows(t *testing.T) {
-       startPath, err := ioutil.TempDir("", "TestRemoveAllLongPath-")
-       if err != nil {
-               t.Fatalf("Could not create TempDir: %s", err)
-       }
-       defer RemoveAll(startPath)
-
-       // Make a long path
-       err = MkdirAll(filepath.Join(startPath, "foo", "bar", strings.Repeat("a", 150),
-               strings.Repeat("b", 150)), ModePerm)
-       if err != nil {
-               t.Fatal(err)
-       }
-
-       err = RemoveAll("foo")
-       if err != nil {
-               t.Fatal(err)
-       }
-}
-
 func TestRemoveAllDot(t *testing.T) {
        prevDir, err := Getwd()
        if err != nil {