FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://code.google.com/p/go/


Description:
path/filepath: better documentation for WalkFunc
Define the properties of the arguments better. In particular,
explain that the path is (sort of) relative to the argument to
Walk.

Fixes issue 4119.

Please review this at http://codereview.appspot.com/6721048/

Affected files:
M src/pkg/path/filepath/path.go


Index: src/pkg/path/filepath/path.go
===================================================================
--- a/src/pkg/path/filepath/path.go
+++ b/src/pkg/path/filepath/path.go
@@ -325,13 +325,18 @@
var SkipDir = errors.New("skip this directory")

// WalkFunc is the type of the function called for each file or directory
-// visited by Walk. If there was a problem walking to the file or
directory
-// named by path, the incoming error will describe the problem and the
-// function can decide how to handle that error (and Walk will not descend
-// into that directory). If an error is returned, processing stops. The
-// sole exception is that if path is a directory and the function returns
the
-// special value SkipDir, the contents of the directory are skipped
-// and processing continues as usual on the next file.
+// visited by Walk. The path argument contains the argument to Walk as a
+// prefix; that is, if Walk is called with "dir", which is a directory
+// containing the file "a", the walk function will be called with argument
+// "dir/a". The info argument is the os.FileInfo for the named path.
+//
+// If there was a problem walking to the file or directory named by path,
the
+// incoming error will describe the problem and the function can decide how
+// to handle that error (and Walk will not descend into that directory). If
+// an error is returned, processing stops. The sole exception is that if
path
+// is a directory and the function returns the special value SkipDir, the
+// contents of the directory are skipped and processing continues as usual
on
+// the next file.
type WalkFunc func(path string, info os.FileInfo, err error) error

// walk recursively descends path, calling w.

Search Discussions

  • R at Oct 17, 2012 at 5:15 am
    Reviewers: golang-dev_googlegroups.com,

    Message:
    Hello golang-dev@googlegroups.com,

    I'd like you to review this change to
    https://code.google.com/p/go/


    Description:
    path/filepath: better documentation for WalkFunc
    Define the properties of the arguments better. In particular,
    explain that the path is (sort of) relative to the argument to
    Walk.

    Fixes issue 4119.

    Please review this at http://codereview.appspot.com/6721048/

    Affected files:
    M src/pkg/path/filepath/path.go


    Index: src/pkg/path/filepath/path.go
    ===================================================================
    --- a/src/pkg/path/filepath/path.go
    +++ b/src/pkg/path/filepath/path.go
    @@ -325,13 +325,18 @@
    var SkipDir = errors.New("skip this directory")

    // WalkFunc is the type of the function called for each file or directory
    -// visited by Walk. If there was a problem walking to the file or
    directory
    -// named by path, the incoming error will describe the problem and the
    -// function can decide how to handle that error (and Walk will not descend
    -// into that directory). If an error is returned, processing stops. The
    -// sole exception is that if path is a directory and the function returns
    the
    -// special value SkipDir, the contents of the directory are skipped
    -// and processing continues as usual on the next file.
    +// visited by Walk. The path argument contains the argument to Walk as a
    +// prefix; that is, if Walk is called with "dir", which is a directory
    +// containing the file "a", the walk function will be called with argument
    +// "dir/a". The info argument is the os.FileInfo for the named path.
    +//
    +// If there was a problem walking to the file or directory named by path,
    the
    +// incoming error will describe the problem and the function can decide how
    +// to handle that error (and Walk will not descend into that directory). If
    +// an error is returned, processing stops. The sole exception is that if
    path
    +// is a directory and the function returns the special value SkipDir, the
    +// contents of the directory are skipped and processing continues as usual
    on
    +// the next file.
    type WalkFunc func(path string, info os.FileInfo, err error) error

    // walk recursively descends path, calling w.
  • Ian Lance Taylor at Oct 17, 2012 at 4:57 am
    LGTM
    On Tue, Oct 16, 2012 at 9:46 PM, wrote:
    Reviewers: golang-dev_googlegroups.com,

    Message:
    Hello golang-dev@googlegroups.com,

    I'd like you to review this change to
    https://code.google.com/p/go/


    Description:
    path/filepath: better documentation for WalkFunc
    Define the properties of the arguments better. In particular,
    explain that the path is (sort of) relative to the argument to
    Walk.

    Fixes issue 4119.

    Please review this at http://codereview.appspot.com/6721048/

    Affected files:
    M src/pkg/path/filepath/path.go


    Index: src/pkg/path/filepath/path.go
    ===================================================================
    --- a/src/pkg/path/filepath/path.go
    +++ b/src/pkg/path/filepath/path.go
    @@ -325,13 +325,18 @@
    var SkipDir = errors.New("skip this directory")

    // WalkFunc is the type of the function called for each file or directory
    -// visited by Walk. If there was a problem walking to the file or
    directory
    -// named by path, the incoming error will describe the problem and the
    -// function can decide how to handle that error (and Walk will not descend
    -// into that directory). If an error is returned, processing stops. The
    -// sole exception is that if path is a directory and the function returns
    the
    -// special value SkipDir, the contents of the directory are skipped
    -// and processing continues as usual on the next file.
    +// visited by Walk. The path argument contains the argument to Walk as a
    +// prefix; that is, if Walk is called with "dir", which is a directory
    +// containing the file "a", the walk function will be called with argument
    +// "dir/a". The info argument is the os.FileInfo for the named path.
    +//
    +// If there was a problem walking to the file or directory named by path,
    the
    +// incoming error will describe the problem and the function can decide how
    +// to handle that error (and Walk will not descend into that directory). If
    +// an error is returned, processing stops. The sole exception is that if
    path
    +// is a directory and the function returns the special value SkipDir, the
    +// contents of the directory are skipped and processing continues as usual
    on
    +// the next file.
    type WalkFunc func(path string, info os.FileInfo, err error) error

    // walk recursively descends path, calling w.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 17, '12 at 4:57a
activeOct 17, '12 at 5:15a
posts3
users2
websitegolang.org

2 users in discussion

R: 2 posts Ian Lance Taylor: 1 post

People

Translate

site design / logo © 2022 Grokbase