Skip to content

Commit 54e20b5

Browse files
committed
doc/go1.17: document fixes for negative rune handling
CL 317273 accidentally grouped a fix for bufio, bytes, strings packages into a single entry, but they should be separate ones. Fix that, and document these negative rune handling fixes. The list of fixed functions in package unicode was computed by taking the functions covered by the new TestNegativeRunes test, and including those that fail when tested with Go 1.16.3. For #44513. Updates #43254. Change-Id: I6f387327f83ae52543526dbdcdd0bb5775c678bd Reviewed-on: https://go-review.googlesource.com/c/go/+/317469 Reviewed-by: David Benjamin <[email protected]> Reviewed-by: Alexander Rakoczy <[email protected]> Trust: Alexander Rakoczy <[email protected]> Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Alexander Rakoczy <[email protected]>
1 parent d2fd503 commit 54e20b5

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

doc/go1.17.html

+37-4
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,25 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
241241
</dd>
242242
</dl><!-- archive/zip -->
243243

244-
<dl id="bufio, bytes, strings"><dt><a href="/pkg/bufio, bytes, strings/">bufio, bytes, strings</a></dt>
244+
<dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
245245
<dd>
246246
<p><!-- CL 280492 -->
247-
TODO: <a href="https://golang.org/cl/280492">https://golang.org/cl/280492</a>: handle negative runes in WriteRune
247+
The <a href="/pkg/bufio/#Writer.WriteRune"><code>Writer.WriteRune</code></a> method
248+
now writes the replacement character U+FFFD for negative rune values,
249+
as it does for other invalid runes.
248250
</p>
249251
</dd>
250-
</dl><!-- bufio, bytes, strings -->
252+
</dl><!-- bufio -->
253+
254+
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
255+
<dd>
256+
<p><!-- CL 280492 -->
257+
The <a href="/pkg/bytes/#Buffer.WriteRune"><code>Buffer.WriteRune</code></a> method
258+
now writes the replacement character U+FFFD for negative rune values,
259+
as it does for other invalid runes.
260+
</p>
261+
</dd>
262+
</dl><!-- bytes -->
251263

252264
<dl id="compress/lzw"><dt><a href="/pkg/compress/lzw/">compress/lzw</a></dt>
253265
<dd>
@@ -416,6 +428,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
416428
</dd>
417429
</dl><!-- strconv -->
418430

431+
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
432+
<dd>
433+
<p><!-- CL 280492 -->
434+
The <a href="/pkg/strings/#Builder.WriteRune"><code>Builder.WriteRune</code></a> method
435+
now writes the replacement character U+FFFD for negative rune values,
436+
as it does for other invalid runes.
437+
</p>
438+
</dd>
439+
</dl><!-- strings -->
440+
419441
<dl id="sync/atomic"><dt><a href="/pkg/sync/atomic/">sync/atomic</a></dt>
420442
<dd>
421443
<p><!-- CL 241678 -->
@@ -477,7 +499,18 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
477499
<dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
478500
<dd>
479501
<p><!-- CL 280493 -->
480-
TODO: <a href="https://golang.org/cl/280493">https://golang.org/cl/280493</a>: correctly handle negative runes
502+
The <a href="/pkg/unicode/#Is"><code>Is</code></a>,
503+
<a href="/pkg/unicode/#IsGraphic"><code>IsGraphic</code></a>,
504+
<a href="/pkg/unicode/#IsLetter"><code>IsLetter</code></a>,
505+
<a href="/pkg/unicode/#IsLower"><code>IsLower</code></a>,
506+
<a href="/pkg/unicode/#IsMark"><code>IsMark</code></a>,
507+
<a href="/pkg/unicode/#IsNumber"><code>IsNumber</code></a>,
508+
<a href="/pkg/unicode/#IsPrint"><code>IsPrint</code></a>,
509+
<a href="/pkg/unicode/#IsPunct"><code>IsPunct</code></a>,
510+
<a href="/pkg/unicode/#IsSpace"><code>IsSpace</code></a>,
511+
<a href="/pkg/unicode/#IsSymbol"><code>IsSymbol</code></a>, and
512+
<a href="/pkg/unicode/#IsUpper"><code>IsUpper</code></a> functions
513+
now return <code>false</code> on negative rune values, as they do for other invalid runes.
481514
</p>
482515
</dd>
483516
</dl><!-- unicode -->

0 commit comments

Comments
 (0)