]> Cypherpunks.ru repositories - gostls13.git/commit
path/filepath: add WalkDir
authorRuss Cox <rsc@golang.org>
Thu, 29 Oct 2020 16:20:53 +0000 (12:20 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 4 Nov 2020 21:45:25 +0000 (21:45 +0000)
commitfd841f65368906923e287afab91857043036459d
tree57515f616773351d87205b581dae0cd8c2444f0d
parent5ed81a3d14aa4eda5de87d7fe074b4c913b58511
path/filepath: add WalkDir

WalkDir is like Walk but can use ReadDir to read directories,
instead of Readdirnames + Lstat on every entry,
which is usually a significant performance improvement.
(The Lstat can still happen if the walk function calls d.Info.)

Fixes #42027.

Change-Id: Ie11024b23be2656e320d41fd81ff0d8810aa729e
Reviewed-on: https://go-review.googlesource.com/c/go/+/266240
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>
src/path/filepath/export_test.go
src/path/filepath/path.go
src/path/filepath/path_test.go