From 08a680a8879ce9da16d808644730f7cfacaf667f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 25 Jun 2012 16:20:03 +0000 Subject: libgo: Update to Go 1.0.2 release. From-SVN: r188943 --- libgo/go/path/filepath/path.go | 7 +++++-- libgo/go/path/filepath/path_plan9.go | 2 +- libgo/go/path/filepath/path_test.go | 31 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) (limited to 'libgo/go/path') diff --git a/libgo/go/path/filepath/path.go b/libgo/go/path/filepath/path.go index a4e429b..815021b 100644 --- a/libgo/go/path/filepath/path.go +++ b/libgo/go/path/filepath/path.go @@ -320,8 +320,11 @@ func walk(path string, info os.FileInfo, walkFn WalkFunc) error { } for _, fileInfo := range list { - if err = walk(Join(path, fileInfo.Name()), fileInfo, walkFn); err != nil { - return err + err = walk(Join(path, fileInfo.Name()), fileInfo, walkFn) + if err != nil { + if !fileInfo.IsDir() || err != SkipDir { + return err + } } } return nil diff --git a/libgo/go/path/filepath/path_plan9.go b/libgo/go/path/filepath/path_plan9.go index cf028a7..59a5812 100644 --- a/libgo/go/path/filepath/path_plan9.go +++ b/libgo/go/path/filepath/path_plan9.go @@ -12,7 +12,7 @@ func IsAbs(path string) bool { } // VolumeName returns the leading volume name on Windows. -// It returns "" elsewhere +// It returns "" elsewhere. func VolumeName(path string) string { return "" } diff --git a/libgo/go/path/filepath/path_test.go b/libgo/go/path/filepath/path_test.go index b876658..097b0d9 100644 --- a/libgo/go/path/filepath/path_test.go +++ b/libgo/go/path/filepath/path_test.go @@ -869,3 +869,34 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) { t.Errorf("Results of EvalSymlinks do not match: %q and %q", flp, fup) } } + +/* This test does not work gccgo, since the sources are arranged + differently. + +func TestBug3486(t *testing.T) { // http://code.google.com/p/go/issues/detail?id=3486 + root, err := filepath.EvalSymlinks(os.Getenv("GOROOT")) + if err != nil { + t.Fatal(err) + } + lib := filepath.Join(root, "lib") + src := filepath.Join(root, "src") + seenSrc := false + filepath.Walk(root, func(pth string, info os.FileInfo, err error) error { + if err != nil { + t.Fatal(err) + } + + switch pth { + case lib: + return filepath.SkipDir + case src: + seenSrc = true + } + return nil + }) + if !seenSrc { + t.Fatalf("%q not seen", src) + } +} + +*/ -- cgit v1.1