Skip to content

Commit

Permalink
improve go doc for LineReader Next
Browse files Browse the repository at this point in the history
  • Loading branch information
leehinman committed Oct 12, 2021
1 parent b44be24 commit 403e576
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libbeat/reader/readfile/line.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ func NewLineReader(input io.ReadCloser, config Config) (*LineReader, error) {
}, nil
}

// Next reads the next line until the new line character
func (r *LineReader) Next() ([]byte, int, error) {
// Next reads the next line until the new line character. The return
// value b is the byte slice that contains the next line. The return
// value n is the number of bytes that were consumed from the
// underlying reader to read the next line. If the LineReader is
// configured with maxBytes n may be larger than the length of b due
// to skipped lines.
func (r *LineReader) Next() (b []byte, n int, err error) {
// This loop is need in case advance detects an line ending which turns out
// not to be one when decoded. If that is the case, reading continues.
for {
Expand Down

0 comments on commit 403e576

Please sign in to comment.