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 <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2021-01-21 18:21:35 -08:00
parent 11def3d40b
commit ec1b945265

View File

@ -872,6 +872,21 @@ func TestFoo(t *testing.T) {
<dl id="path/filepath"><dt><a href="/pkg/path/filepath/">path/filepath</a></dt>
<dd>
<p><!-- CL 267887 -->
The new function
<a href="/pkg/path/filepath/WalkDir"><code>WalkDir</code></a>
is similar to
<a href="/pkg/path/filepath/Walk"><code>Walk</code></a>,
but is typically more efficient.
The function passed to <code>WalkDir</code> receives a
<a href="/pkg/io/fs/#DirEntry"><code>fs.DirEntry</code></a>
instead of a
<a href="/pkg/io/fs/#FileInfo"><code>fs.FileInfo</code></a>.
(To clarify for those who recall the <code>Walk</code> function
as taking an <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a>,
<code>os.FileInfo</code> is now an alias for <code>fs.FileInfo</code>.)
</p>
<p><!-- CL 264397, golang.org/issues/28614 -->
The <a href="/pkg/path/filepath#Match"><code>Match</code></a> and
<a href="/pkg/path/filepath#Glob"><code>Glob</code></a> functions now