Read to do some little change of webdav in golang.org/x/net

This commit is contained in:
zicla
2019-04-14 01:55:15 +08:00
parent e9efc70f7c
commit ec60a96172
23 changed files with 8006 additions and 166 deletions

View File

@ -748,7 +748,7 @@ func copyFiles(ctx context.Context, fs FileSystem, src, dst string, overwrite bo
// Allowed values for depth are 0, 1 or infiniteDepth. For each visited node,
// walkFS calls walkFn. If a visited file system node is a directory and
// walkFn returns filepath.SkipDir, walkFS will skip traversal of this node.
func WalkFS(ctx context.Context, fs FileSystem, depth int, name string, info os.FileInfo, walkFn filepath.WalkFunc) error {
func walkFS(ctx context.Context, fs FileSystem, depth int, name string, info os.FileInfo, walkFn filepath.WalkFunc) error {
// This implementation is based on Walk's code in the standard path/filepath package.
err := walkFn(name, info, nil)
if err != nil {
@ -783,7 +783,7 @@ func WalkFS(ctx context.Context, fs FileSystem, depth int, name string, info os.
return err
}
} else {
err = WalkFS(ctx, fs, depth, filename, fileInfo, walkFn)
err = walkFS(ctx, fs, depth, filename, fileInfo, walkFn)
if err != nil {
if !fileInfo.IsDir() || err != filepath.SkipDir {
return err