]> Cypherpunks repositories - gostls13.git/commitdiff
bufio: document that NewWriter can return its argument
authorIan Lance Taylor <iant@golang.org>
Mon, 8 Nov 2021 21:57:50 +0000 (13:57 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 9 Nov 2021 20:06:10 +0000 (20:06 +0000)
Fixes #49446

Change-Id: Ib0b53a7dd5d567a2dd0bdf29f53d276587b60afb
Reviewed-on: https://go-review.googlesource.com/c/go/+/361921
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
src/bufio/bufio.go

index 063a7785f3637aa59c6ef8b8f62ed8a49e3e41a1..9ea058db3eddd54dae5d0ccecd71120f58ae05b4 100644 (file)
@@ -593,6 +593,8 @@ func NewWriterSize(w io.Writer, size int) *Writer {
 }
 
 // NewWriter returns a new Writer whose buffer has the default size.
+// If the argument io.Writer is already a Writer with large enough buffer size,
+// it returns the underlying Writer.
 func NewWriter(w io.Writer) *Writer {
        return NewWriterSize(w, defaultBufSize)
 }