]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.14: mention better error checking in text/template
authorIan Lance Taylor <iant@golang.org>
Wed, 5 Feb 2020 22:12:04 +0000 (14:12 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 5 Feb 2020 22:36:18 +0000 (22:36 +0000)
This caused 35 test failures in Google internal code,
so it's worth mentioning in the release notes.

Updates #31810
Updates #36878
Fixes #37066

Change-Id: I2faa6bce4c7d735107eceaef7d95223844846454
Reviewed-on: https://go-review.googlesource.com/c/go/+/217978
Reviewed-by: Rob Pike <r@golang.org>
doc/go1.14.html

index 35f9955d2af379b0801287ea3d3f5ad1d26f1c85..b3423f875350dcd1dd441cb613eba4b0e2465873 100644 (file)
@@ -823,6 +823,20 @@ appropriately.)
     </p>
 </dl><!-- testing -->
 
+<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
+  <dd>
+    <p><!-- CL 206124 -->
+      The text/template package now correctly reports errors when a
+      parenthesized argument is used as a function.
+      This most commonly shows up in erroneous cases like
+      <code>{{if (eq .F "a") or (eq .F "b")}}</code>.
+      This should be written as <code>{{if or (eq .F "a") (eq .F "b")}}</code>.
+      The erroneous case never worked as expected, and will now be
+      reported with an error <code>can't give argument to non-function</code>.
+    </p>
+  </dd>
+</dl><!-- text/template -->
+
 <dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
   <dd>
     <p>