Skip to content

Commit 65bd076

Browse files
committed
io: add a comment about how to turn a Reader into ByteReader
Offered as an alternative to CL 221380, which was more tutorial than necessary. Update #37344 Change-Id: Ide673b0b97983c2c2319a9311dc3d0a10567e6c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/223097 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 67d93cf commit 65bd076

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/io/io.go

+4
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ type WriterAt interface {
236236
// ReadByte reads and returns the next byte from the input or
237237
// any error encountered. If ReadByte returns an error, no input
238238
// byte was consumed, and the returned byte value is undefined.
239+
//
240+
// ReadByte provides an efficient interface for byte-at-time
241+
// processing. A Reader that does not implement ByteReader
242+
// can be wrapped using bufio.NewReader to add this method.
239243
type ByteReader interface {
240244
ReadByte() (byte, error)
241245
}

0 commit comments

Comments
 (0)