Skip to content

path/filepath: Walk behavior change from Go 1.1 #6679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bradfitz opened this issue Oct 28, 2013 · 2 comments
Closed

path/filepath: Walk behavior change from Go 1.1 #6679

bradfitz opened this issue Oct 28, 2013 · 2 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

filepath.Walk's WalkFunc (http://golang.org/pkg/path/filepath/#WalkFunc) is documented
as:

"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). "

That is, it returns the stat error for that name.

But Walk is implemented using (*os.File).Readdir
(http://golang.org/pkg/os/#File.Readdir), which was changed in

https://code.google.com/p/go/source/detail?r=100a10512ea4#

... to match its documentation.

That changed the behavior of filepath.Walk to now bail on any errors, rather than call
the WalkFunc callback with a (problemFilename, nil, errFromStat).

A fix was proposed at https://golang.org/cl/16100043/
@bradfitz
Copy link
Contributor Author

Comment 1:

filepath.Walk's WalkFunc (http://golang.org/pkg/path/filepath/#WalkFunc) is documented
as:
"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). "
That is, it returns the stat error for that name.
But Walk is implemented using (*os.File).Readdir
(http://golang.org/pkg/os/#File.Readdir), which was changed in
https://code.google.com/p/go/source/detail?r=100a10512ea4#
... to match its documentation.
That changed the behavior of filepath.Walk to now bail on any errors, rather than call
the WalkFunc callback with a (problemFilename, nil, errFromStat).
A fix was proposed at https://golang.org/cl/16100043/

@bradfitz
Copy link
Contributor Author

Comment 2:

Status changed to Duplicate.

Merged into issue #6656.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants