go/src/bufio
Carlo Alberto Ferraris 21e1ffe7bc bufio: implement large write forwarding in Writer.WriteString
Currently bufio.Writer implements forwarding to the underlying Writer
for large writes via Write, but it does not do the same for large
writes via WriteString.

If the underlying Writer is also a StringWriter, use the same "large
writes" logic also in WriteString while taking care to only check
once per call to WriteString whether the underlying Writer implements
StringWriter.

Change-Id: Id81901c07b035936816b9e41b1f5688e699ee8e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/380074
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-04-21 23:41:03 +00:00
..
bufio_test.go bufio: implement large write forwarding in Writer.WriteString 2022-04-21 23:41:03 +00:00
bufio.go bufio: implement large write forwarding in Writer.WriteString 2022-04-21 23:41:03 +00:00
example_test.go bufio: add Writer.AvailableBuffer 2021-09-12 01:06:53 +00:00
export_test.go
scan_test.go bufio: test for exact error value in TestNegativeEOFReader and TestLargeReader 2020-06-17 14:47:32 +00:00
scan.go all: remove trailing blank doc comment lines 2022-04-01 18:18:07 +00:00