1
0
mirror of https://github.com/golang/go synced 2024-11-17 13:14:56 -07:00
go/src/path
Russ Cox 362d25f2c8 io/fs: add WalkDir
This commit is a copy of filepath.WalkDir adapted to use fs.FS
instead of the native OS file system. It is the last implementation
piece of the io/fs proposal.

The original io/fs proposal was to adopt filepath.Walk, but we
have since introduced the more efficient filepath.WalkDir (#42027),
so this CL adopts that more efficient option instead.

(The changes in path/filepath bring the two copies more in line
with each other. The main change is unembedding the field
in statDirEntry, so that the fs.DirEntry passed to the WalkDirFunc
for the root of the tree does not have any extra methods.)

For #41190.

Change-Id: I9359dfcc110338c0ec64535f22cafb38d0b613a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/243916
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2020-11-06 19:42:05 +00:00
..
filepath io/fs: add WalkDir 2020-11-06 19:42:05 +00:00
example_test.go
match_test.go io/fs, path, path/filepath, testing/fstest: validate patterns in Match, Glob 2020-10-23 14:59:03 +00:00
match.go io/fs, path, path/filepath, testing/fstest: validate patterns in Match, Glob 2020-10-23 14:59:03 +00:00
path_test.go path: avoid import of strings 2020-10-13 01:12:09 +00:00
path.go path: avoid import of strings 2020-10-13 01:12:09 +00:00