Skip to content

path/filepath: function filepath.Walk() handle filepath.SkipDir incorrectly #10533

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
crvv opened this issue Apr 22, 2015 · 1 comment
Closed
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Milestone

Comments

@crvv
Copy link
Contributor

crvv commented Apr 22, 2015

What version of Go are you using (go version)?
go version go1.4.2 linux/amd64

What did you do?
Use filepath.Walk to read a directory and use filepath.SkipDir to skip some file and directory.
Example: http://play.golang.org/p/HrVSM8ATcn

What did you expect to see?
In documetation https://golang.org/pkg/path/filepath/#WalkFunc
type WalkFunc func(path string, info os.FileInfo, err error) error
"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."
I expect that when path is a file and the function returns SkipDir, this file will be skipped and the rest files in the same directory will be processed.
In the example, it should be: http://play.golang.org/p/RRh41o1bU-

What did you see instead?
When path is a file and the function returns SkipDir, this file will be skipped and the rest files in the same directory will also be skipped.

This issue can be solved easily. But I am not sure whether it is an issue about code or documentation.

@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Apr 22, 2015
@ianlancetaylor ianlancetaylor added the Documentation Issues describing a change to documentation. label Apr 22, 2015
@robpike robpike self-assigned this Apr 22, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/11690 mentions this issue.

@rsc rsc closed this as completed in 4df6b1e Jun 29, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jun 30, 2015
@golang golang locked and limited conversation to collaborators Jun 29, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

5 participants