]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.16: mention path/filepath.WalkDir
authorIan Lance Taylor <iant@golang.org>
Fri, 22 Jan 2021 02:21:35 +0000 (18:21 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 22 Jan 2021 06:35:01 +0000 (06:35 +0000)
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>
doc/go1.16.html

index aa70ec8c823d443a962312ba909a7df33cd51467..b3166fbaf53dddfc5108caa0bc588c08e4c69ada 100644 (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