starts a goroutine to drive the channel line output does not include the trailing newline
(input io.Reader)
| 71 | // starts a goroutine to drive the channel |
| 72 | // line output does not include the trailing newline |
| 73 | func StreamToLinesChan(input io.Reader) chan LineOutput { |
| 74 | ch := make(chan LineOutput) |
| 75 | go func() { |
| 76 | defer close(ch) |
| 77 | err := StreamToLines(input, func(line []byte) { |
| 78 | ch <- LineOutput{Line: string(line)} |
| 79 | }) |
| 80 | if err != nil && err != io.EOF { |
| 81 | ch <- LineOutput{Error: err} |
| 82 | } |
| 83 | }() |
| 84 | return ch |
| 85 | } |
| 86 | |
| 87 | // LineWriter is an io.Writer that processes data line-by-line via a callback. |
| 88 | // Lines do not include the trailing newline. Lines longer than maxLineLength are dropped. |
nothing calls this directly
no test coverage detected