Commit 4871d0d1 authored by Rob Pike's avatar Rob Pike

encoding/line: fix up a few typos and infelicities in the doc comments

R=anschelsc, agl1
CC=golang-dev
https://golang.org/cl/3988045
parent c4513d3b
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// This package implements a Reader which handles reading \r and \r\n // The line package implements a Reader that reads lines delimited by '\n' or ' \r\n'.
// deliminated lines.
package line package line
import ( import (
...@@ -11,8 +10,7 @@ import ( ...@@ -11,8 +10,7 @@ import (
"os" "os"
) )
// Reader reads lines from an io.Reader (which may use either '\n' or // Reader reads lines, delimited by '\n' or \r\n', from an io.Reader.
// '\r\n').
type Reader struct { type Reader struct {
buf []byte buf []byte
consumed int consumed int
...@@ -20,11 +18,13 @@ type Reader struct { ...@@ -20,11 +18,13 @@ type Reader struct {
err os.Error err os.Error
} }
func NewReader(in io.Reader, maxLineLength int) *Reader { // NewReader returns a new Reader that will read successive
// lines from the input Reader.
func NewReader(input io.Reader, maxLineLength int) *Reader {
return &Reader{ return &Reader{
buf: make([]byte, 0, maxLineLength), buf: make([]byte, 0, maxLineLength),
consumed: 0, consumed: 0,
in: in, in: input,
} }
} }
......
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