document bufio

R=rsc
DELTA=61  (27 added, 2 deleted, 32 changed)
OCL=25877
CL=25889
This commit is contained in:
Rob Pike 2009-03-07 16:57:01 -08:00
parent 333cdd8f2a
commit 5dd4ef5716
3 changed files with 59 additions and 34 deletions

View file

@ -108,7 +108,7 @@ func readLines(b *BufRead) string {
s := "";
for {
s1, e := b.ReadLineString('\n', true);
if e == EndOfFile {
if e == io.ErrEOF {
break
}
if e != nil {
@ -125,7 +125,7 @@ func readBytes(buf *BufRead) string {
nb := 0;
for {
c, e := buf.ReadByte();
if e == EndOfFile {
if e == io.ErrEOF {
break
}
if e != nil {
@ -145,7 +145,7 @@ func reads(buf *BufRead, m int) string {
for {
n, e := buf.Read(b[nb:nb+m]);
nb += n;
if e == EndOfFile {
if e == io.ErrEOF {
break
}
}