Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Iter ¶
Iter reads lines from r and calls fn with each read line, not including the line terminator. If a line exceeds the given maximum size, it will be truncated and the rest of the line discarded. If fn returns a non-nil error, reading ends and the error is returned from Iter. When EOF is encountered, Read returns nil.
Example ¶
package main import ( "code.google.com/p/rog-go/readlines" "fmt" "strings" ) func main() { input := `one two three four five` r := strings.NewReader(input) readlines.Iter(r, 1024*1024, func(line []byte) error { fmt.Printf("%q\n", line) return nil }) }
Output: "one two" "three" "four" "" "five"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.