Skip to content

Commit 96b5f6d

Browse files
committed
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 <[email protected]>
1 parent ac1cb99 commit 96b5f6d

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

doc/go1.11.html

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ <h2 id="tools">Tools</h2>
132132

133133
<h3 id="modules">Modules, package versioning, and dependency management</h3>
134134
<p>
135-
<strong>
136-
NOTE: This is not present in go1.11beta1 but will be available in future
137-
betas and subsequent releases.
138-
</strong>
139135
Go 1.11 adds preliminary support for a <a href="/cmd/go/#hdr-Modules__module_versions__and_more">new concept called “modules,”</a>
140136
an alternative to GOPATH with integrated support for versioning and
141137
package distribution.
@@ -711,19 +707,35 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
711707
<dl id="text/scanner"><dt><a href="/pkg/text/scanner/">text/scanner</a></dt>
712708
<dd>
713709
<p><!-- CL 112037 -->
714-
TODO: <a href="https://golang.org/cl/112037">https://golang.org/cl/112037</a>: return RawString token rather than String for raw string literals
710+
<code>Scan()</code> now returns a <code>RawString</code> token instead of <code>String</code>
711+
for raw string literals.
715712
</p>
716713

717714
</dl><!-- text/scanner -->
718715

719716
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
720717
<dd>
721718
<p><!-- CL 84480 -->
722-
TODO: <a href="https://golang.org/cl/84480">https://golang.org/cl/84480</a>: add variable assignments
719+
Modifying template variables via assignments is now permitted via the <code>=</code> token:
720+
</p>
721+
<pre>
722+
{{"{{"}} $v := "init" {{"}}"}}
723+
{{"{{"}} if true {{"}}"}}
724+
{{"{{"}} $v = "changed" {{"}}"}}
725+
{{"{{"}} end {{"}}"}}
726+
v: {{"{{"}} $v {{"}}"}} {{"{{"}}/* "changed" */{{"}}"}}</pre>
727+
728+
<p>
729+
This required backwards-incompatible changes to the <code>text/template/parse</code>
730+
package, but was deemed acceptable since the package's documentation clearly states
731+
that it isn't intended for general use.
723732
</p>
724733

725734
<p><!-- CL 95215 -->
726-
TODO: <a href="https://golang.org/cl/95215">https://golang.org/cl/95215</a>: differentiate nil from missing arg
735+
In previous versions, passing an untyped nil to a template function
736+
would result in an incorrect error stating that the function was missing an argument.
737+
Errors resulting from untyped nil values being passed to template-evaluated functions
738+
are now properly reported.
727739
</p>
728740

729741
</dl><!-- text/template -->

0 commit comments

Comments
 (0)