aboutsummaryrefslogtreecommitdiff
path: root/src/bufio
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-11-08 13:57:50 -0800
committerIan Lance Taylor <iant@golang.org>2021-11-09 20:06:10 +0000
commit8c20584a8206844be705c50efe8aabb6ab9c503e (patch)
tree71eee546219dfa8cc90a51cec43ca55785e1c3de /src/bufio
parentd3aedb72c687cc58e10755eff006a4dd45cb8e15 (diff)
downloadgo-8c20584a8206844be705c50efe8aabb6ab9c503e.tar.xz
bufio: document that NewWriter can return its argument
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>
Diffstat (limited to 'src/bufio')
-rw-r--r--src/bufio/bufio.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go
index 063a7785f3..9ea058db3e 100644
--- a/src/bufio/bufio.go
+++ b/src/bufio/bufio.go
@@ -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)
}