Update deps

This commit is contained in:
Andrey Nering
2018-06-24 10:40:44 -03:00
parent 09eab770a7
commit f4d3855528
131 changed files with 15927 additions and 5676 deletions

View File

@@ -39,6 +39,16 @@ var TraverseLink = errors.New("traverse symlink, assuming target is a directory"
// sentinel error. It is the walkFn's responsibility to prevent
// fastWalk from going into symlink cycles.
func FastWalk(root string, walkFn func(path string, typ os.FileMode) error) error {
// Check if "root" is actually a file, not a directory.
stat, err := os.Stat(root)
if err != nil {
return err
}
if !stat.IsDir() {
// If it is, just directly pass it to walkFn and return.
return walkFn(root, stat.Mode())
}
// TODO(bradfitz): make numWorkers configurable? We used a
// minimum of 4 to give the kernel more info about multiple
// things we want, in hopes its I/O scheduling can take