Commit ea392b88 authored by Russ Cox's avatar Russ Cox

bufio: discourage use of ReadLine

Too many people use it without reading what it does.
Those people want ReadBytes or ReadString.

Fixes #3906.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/6442087
parent ff03482f
...@@ -272,6 +272,9 @@ func (b *Reader) ReadSlice(delim byte) (line []byte, err error) { ...@@ -272,6 +272,9 @@ func (b *Reader) ReadSlice(delim byte) (line []byte, err error) {
panic("not reached") panic("not reached")
} }
// ReadLine is a low-level line-reading primitive. Most callers should use
// ReadBytes('\n') or ReadString('\n') instead.
//
// ReadLine tries to return a single line, not including the end-of-line bytes. // ReadLine tries to return a single line, not including the end-of-line bytes.
// If the line was too long for the buffer then isPrefix is set and the // If the line was too long for the buffer then isPrefix is set and the
// beginning of the line is returned. The rest of the line will be returned // beginning of the line is returned. The rest of the line will be returned
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment