From 563287ae0636a592880dc616b50fde217fa1100f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 13 Jan 2020 23:34:53 +0000 Subject: [PATCH] Revert "os: handle long path in RemoveAll for windows" 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 --- src/os/removeall_noat.go | 1 - src/os/removeall_test.go | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/src/os/removeall_noat.go b/src/os/removeall_noat.go index 6474d2d54e..c1b43e3807 100644 --- a/src/os/removeall_noat.go +++ b/src/os/removeall_noat.go @@ -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 diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go index 6fb31c2d8f..8a71f687ed 100644 --- a/src/os/removeall_test.go +++ b/src/os/removeall_test.go @@ -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 { -- 2.50.0