1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:44:40 -07:00

godoc: log errors when reading filter files

R=r, r2
CC=golang-dev
https://golang.org/cl/4230042
This commit is contained in:
Robert Griesemer 2011-02-24 10:22:32 -08:00
parent 87fe958a49
commit 11bda7df47

View File

@ -148,8 +148,13 @@ func readDirList(filename string) ([]string, os.Error) {
} }
// create a sorted list of valid directory names // create a sorted list of valid directory names
filter := func(path string) bool { filter := func(path string) bool {
d, err := os.Lstat(path) d, e := os.Lstat(path)
return err == nil && isPkgDir(d) if e != nil && err == nil {
// remember first error and return it from readDirList
// so we have at least some information if things go bad
err = e
}
return e == nil && isPkgDir(d)
} }
list := canonicalizePaths(strings.Split(string(contents), "\n", -1), filter) list := canonicalizePaths(strings.Split(string(contents), "\n", -1), filter)
// for each parent path, remove all it's children q // for each parent path, remove all it's children q
@ -161,7 +166,7 @@ func readDirList(filename string) ([]string, os.Error) {
i++ i++
} }
} }
return list[0:i], nil return list[0:i], err
} }