]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.18: document {text,html}/template {break,continue} commands
authorIan Lance Taylor <iant@golang.org>
Tue, 21 Dec 2021 22:44:27 +0000 (14:44 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 22 Dec 2021 00:11:21 +0000 (00:11 +0000)
For #20531
For #47694

Change-Id: Iaefaa0a8982eabf59cd6a53120c8af9124d60d1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/373915
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
doc/go1.18.html

index 90bc0aa13255e39ffab59b62cc463ee2e1d2eda5..cea45542db16f986ce853e6d3a72fc04e7aae619 100644 (file)
@@ -678,6 +678,17 @@ Do not send CLs removing the interior tags from such phrases.
   </dd>
 </dl>
 
+<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
+  <dd>
+    <p><!-- CL 321491 -->
+      Within a <code>range</code> pipeline the new
+      <code>{{break}}</code> command will end the loop early and the
+      new <code>{{continue}}</code> command will immediately start the
+      next loop iteration.
+    </p>
+  </dd>
+</dl><!-- html/template -->
+
 <dl id="image/draw"><dt><a href="/pkg/image/draw/">image/draw</a></dt>
   <dd>
     <p><!-- CL 340049 -->
@@ -907,6 +918,13 @@ Do not send CLs removing the interior tags from such phrases.
 
 <dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
   <dd>
+    <p><!-- CL 321491 -->
+      Within a <code>range</code> pipeline the new
+      <code>{{break}}</code> command will end the loop early and the
+      new <code>{{continue}}</code> command will immediately start the
+      next loop iteration.
+    </p>
+
     <p><!-- CL 321490 -->
       The <code>and</code> function no longer always evaluates all arguments; it
       stops evaluating arguments after the first argument that evaluates to
@@ -917,6 +935,25 @@ Do not send CLs removing the interior tags from such phrases.
   </dd>
 </dl><!-- text/template -->
 
+<dl id="text/template/parse"><dt><a href="/pkg/text/template/parse/">text/template/parse</a></dt>
+  <dd>
+    <p><!-- CL 321491 -->
+      The package supports the new
+      <a href="/pkg/text/template/">text/template</a> and
+      <a href="/pkg/html/template/">html/template</a>
+      <code>{{break}}</code> command via the new constant
+      <a href="/pkg/text/template/parse#NodeBreak"><code>NodeBreak</code></a>
+      and the new type
+      <a href="/pkg/text/template/parse#BreakNode"><code>BreakNode</code></a>,
+      and similarly supports the new <code>{{continue}}</code> command
+      via the new constant
+      <a href="/pkg/text/template/parse#NodeContinue"><code>NodeContinue</code></a>
+      and the new type
+      <a href="/pkg/text/template/parse#ContinueNode"><code>ContinueNode</code></a>.
+    </p>
+  </dd>
+</dl><!-- text/template -->
+
 <dl id="unicode/utf8"><dt><a href="/pkg/unicode/utf8/">unicode/utf8</a></dt>
   <dd>
     <p><!-- CL 345571 -->