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.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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: