powerwalk icon indicating copy to clipboard operation
powerwalk copied to clipboard

Implement `SkipDir` in powerwalk

Open piotrrojek opened this issue 9 years ago • 2 comments

Simple implementation of SkipDir function.

Addresses #1

piotrrojek avatar Feb 26 '16 06:02 piotrrojek

I just realized the issue was related to original Walk from standard library. Oh well... But maybe it could be useful.

piotrrojek avatar Feb 26 '16 06:02 piotrrojek

Ah nice. The spec for filepath.Walk asks that the WalkFunc returns an error (filepath.SkipDir) in order to skip the directory. Since walking occurs concurrently, this cannot be done, so I like this approach. Perhaps a SkipDir(path string, info os.FileInfo) bool func would be nice to let the calling code decide this at runtime, rather than having to know up-front?

matryer avatar Feb 26 '16 10:02 matryer