You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:
Run "go version" and compare against
http://golang.org/doc/devel/release.html If a newer version of Go exists,
install it and retry what you did to reproduce the problem.
Thanks.
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. create a tree of stuff in /tmp, make sure one directory with children is does not
have permissions for you to access.
filepath.Walk("/tmp", func f(path string, info os.Fileinfo, err error) {
if info.IsDir() && err != nil {
//I don't care, keep going.
return filepath.SkipDir
} else {
//good stuff here
fmt.Printf("Found %s\n", path)
}
}
What is the expected output?
The whole tree, excluding things you don't have permission to.
What do you see instead?
The first permission denied cuts short the tree walk.
Fix?
This looks to be because filepath.walk only checks for SkipDir when err = nil.
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Windows
Which version are you using? (run 'go version')
1
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
…vior
««« backport 4ef88bab4b0d
path/filepath: implement documented SkipDir behavior
Currently walk() doesn't check for err == SkipDir when iterating
a directory list, but such promise is made in the docs for WalkFunc.
Fixes#3486.
R=rsc, r
CC=golang-dev
https://golang.org/cl/6257059
»»»
by kfox1111:
The text was updated successfully, but these errors were encountered: