1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:10:22 -07:00

doc: update go1.11 release notes

Update text/scanner and text/template sections.

Change-Id: I1a273e99ff400870053cca63cea68fb7a9b56764
Reviewed-on: https://go-review.googlesource.com/124705
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Andrew Bonventre 2018-07-18 15:04:02 -04:00
parent ac1cb992ea
commit 96b5f6dd1d

View File

@ -132,10 +132,6 @@ Do not send CLs removing the interior tags from such phrases.
<h3 id="modules">Modules, package versioning, and dependency management</h3>
<p>
<strong>
NOTE: This is not present in go1.11beta1 but will be available in future
betas and subsequent releases.
</strong>
Go 1.11 adds preliminary support for a <a href="/cmd/go/#hdr-Modules__module_versions__and_more">new concept called “modules,”</a>
an alternative to GOPATH with integrated support for versioning and
package distribution.
@ -711,7 +707,8 @@ func f(v interface{}) {
<dl id="text/scanner"><dt><a href="/pkg/text/scanner/">text/scanner</a></dt>
<dd>
<p><!-- CL 112037 -->
TODO: <a href="https://golang.org/cl/112037">https://golang.org/cl/112037</a>: return RawString token rather than String for raw string literals
<code>Scan()</code> now returns a <code>RawString</code> token instead of <code>String</code>
for raw string literals.
</p>
</dl><!-- text/scanner -->
@ -719,11 +716,26 @@ func f(v interface{}) {
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
<dd>
<p><!-- CL 84480 -->
TODO: <a href="https://golang.org/cl/84480">https://golang.org/cl/84480</a>: add variable assignments
Modifying template variables via assignments is now permitted via the <code>=</code> token:
</p>
<pre>
{{"{{"}} $v := "init" {{"}}"}}
{{"{{"}} if true {{"}}"}}
{{"{{"}} $v = "changed" {{"}}"}}
{{"{{"}} end {{"}}"}}
v: {{"{{"}} $v {{"}}"}} {{"{{"}}/* "changed" */{{"}}"}}</pre>
<p>
This required backwards-incompatible changes to the <code>text/template/parse</code>
package, but was deemed acceptable since the package's documentation clearly states
that it isn't intended for general use.
</p>
<p><!-- CL 95215 -->
TODO: <a href="https://golang.org/cl/95215">https://golang.org/cl/95215</a>: differentiate nil from missing arg
In previous versions, passing an untyped nil to a template function
would result in an incorrect error stating that the function was missing an argument.
Errors resulting from untyped nil values being passed to template-evaluated functions
are now properly reported.
</p>
</dl><!-- text/template -->