]> Cypherpunks repositories - gostls13.git/commitdiff
[go] doc: add new bufio functionality
authorJeremy Faller <jeremy@golang.org>
Fri, 19 Nov 2021 18:56:24 +0000 (13:56 -0500)
committerJeremy Faller <jeremy@golang.org>
Fri, 19 Nov 2021 21:36:17 +0000 (21:36 +0000)
cl/345570
cl/345569

Updates: #47694
Change-Id: I170af16d5fc9f022d3d29ed0772cfc3d02b8bbcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/365317
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
doc/go1.18.html

index 1ad651ffe85786c0ed8b9971289d233533f11335..3018ed1b4a8cf50c6fa733ae40614799e8d3f7b1 100644 (file)
@@ -236,11 +236,17 @@ proposal</a>.
 <dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
   <dd>
     <p><!-- CL 345569 -->
-      TODO: <a href="https://golang.org/cl/345569">https://golang.org/cl/345569</a>: add Writer.AvailableBuffer
+      The new <a href="/pkg/bufio#AvailableBuffer"><code>Writer.AvailableBuffer</code></a>
+      method returns an empty buffer with a possibly non-empty capacity for use
+      with append-like APIs. After appending, the buffer can be provided to a
+                       succeeding <code>Write</code> call and possibly avoid any copying.
     </p>
 
     <p><!-- CL 345570 -->
-      TODO: <a href="https://golang.org/cl/345570">https://golang.org/cl/345570</a>: make Reader.Reset and Writer.Reset work on the zero value
+      The methods <a href="/pkg/bufio#Reader.Reset"><code>Reader.Reset</code></a> and
+      <a href="/pkg/bufio#Writer.Reset"><code>Writer.Reset</code></a>
+      now use the default buffer size when called on objects with a
+      <code>nil</code> buffer.
     </p>
   </dd>
 </dl><!-- bufio -->