Skip to content

Commit ec1b945

Browse files
doc/go1.16: mention path/filepath.WalkDir
For #40700 For #42027 Change-Id: Ifb73050dfdab21784fa52d758ad9c408e6489684 Reviewed-on: https://go-review.googlesource.com/c/go/+/285595 Trust: Ian Lance Taylor <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 11def3d commit ec1b945

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/go1.16.html

+15
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,21 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
872872

873873
<dl id="path/filepath"><dt><a href="/pkg/path/filepath/">path/filepath</a></dt>
874874
<dd>
875+
<p><!-- CL 267887 -->
876+
The new function
877+
<a href="/pkg/path/filepath/WalkDir"><code>WalkDir</code></a>
878+
is similar to
879+
<a href="/pkg/path/filepath/Walk"><code>Walk</code></a>,
880+
but is typically more efficient.
881+
The function passed to <code>WalkDir</code> receives a
882+
<a href="/pkg/io/fs/#DirEntry"><code>fs.DirEntry</code></a>
883+
instead of a
884+
<a href="/pkg/io/fs/#FileInfo"><code>fs.FileInfo</code></a>.
885+
(To clarify for those who recall the <code>Walk</code> function
886+
as taking an <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a>,
887+
<code>os.FileInfo</code> is now an alias for <code>fs.FileInfo</code>.)
888+
</p>
889+
875890
<p><!-- CL 264397, golang.org/issues/28614 -->
876891
The <a href="/pkg/path/filepath#Match"><code>Match</code></a> and
877892
<a href="/pkg/path/filepath#Glob"><code>Glob</code></a> functions now

0 commit comments

Comments
 (0)