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
What version of Go are you using (go version)?
go version go1.6.1 darwin/amd64
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOOS="darwin"
What did you do?
Returned filepath.SkipDir in a filepath.WalkFunc when the file was not a directory.
What did you expect to see? filepath.Walk would return nil
What did you see instead? filepath.Walk returned filepath.SkipDir
I don't know whether this is an issue with the documentation or implementation, but the behavior seems to contradict the documentation for filepath.WalkFunc.
If an error is returned, processing stops. The sole exception is when the function returns the special value SkipDir. If the function returns SkipDir when invoked on a directory, Walk skips the directory's contents entirely. If the function returns SkipDir when invoked on a non-directory file, Walk skips the remaining files in the containing directory.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
filepath.SkipDir does not work as expected for non-directory files
path/filepath: SkipDir does not work as expected for non-directory files
Jul 6, 2016
go version
)?go version go1.6.1 darwin/amd64
go env
)?GOARCH="amd64"
GOOS="darwin"
Returned
filepath.SkipDir
in afilepath.WalkFunc
when the file was not a directory.filepath.Walk
would returnnil
filepath.Walk
returnedfilepath.SkipDir
I don't know whether this is an issue with the documentation or implementation, but the behavior seems to contradict the documentation for
filepath.WalkFunc
.The text was updated successfully, but these errors were encountered: