]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.18: add short-circuit evaluation for text/template
authorJeremy Faller <jeremy@golang.org>
Fri, 19 Nov 2021 21:51:47 +0000 (16:51 -0500)
committerJeremy Faller <jeremy@golang.org>
Thu, 2 Dec 2021 20:45:47 +0000 (20:45 +0000)
This description is based on https://golang.org/cl/321490.

Updates #47694

Change-Id: I48656cd487d2fccf0b0d3390f350f1bc6f2b0080
Reviewed-on: https://go-review.googlesource.com/c/go/+/365738
Trust: Jeremy Faller <jeremy@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
doc/go1.18.html

index d9da160ab598ff58dbaf0c6d1c317c3134b75883..74d0e0c23eb9dcb999e8b649cf3434c42b30620d 100644 (file)
@@ -290,7 +290,7 @@ proposal</a>.
 <dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
   <dd>
     <p><!-- CL 345569 -->
-      The new <a href="/pkg/bufio#AvailableBuffer"><code>Writer.AvailableBuffer</code></a>
+      The new <a href="/pkg/bufio#Writer.AvailableBuffer"><code>Writer.AvailableBuffer</code></a>
       method returns an empty buffer with a possibly non-empty capacity for use
       with append-like APIs. After appending, the buffer can be provided to a
                        succeeding <code>Write</code> call and possibly avoid any copying.
@@ -517,7 +517,11 @@ proposal</a>.
 <dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
   <dd>
     <p><!-- CL 321490 -->
-      TODO: <a href="https://golang.org/cl/321490">https://golang.org/cl/321490</a>: implement short-circuit and, or
+      The <code>and</code> function no longer always evaluates all arguments; it
+      stops evaluating arguments after the first argument that evaluates to
+      false.  Similarly, the <code>or</code> function now stops evaluating
+      arguments after the first argument that evaluates to true. This makes a
+      difference if any of the arguments is a function call.
     </p>
   </dd>
 </dl><!-- text/template -->