CountLines returns the number of lines of input, or an error.
()
| 281 | |
| 282 | // CountLines returns the number of lines of input, or an error. |
| 283 | func (p *Pipe) CountLines() (lines int, err error) { |
| 284 | p.FilterScan(func(line string, w io.Writer) { |
| 285 | lines++ |
| 286 | }).Wait() |
| 287 | return lines, p.Error() |
| 288 | } |
| 289 | |
| 290 | // DecodeBase64 produces the string represented by the base64 encoded input. |
| 291 | func (p *Pipe) DecodeBase64() *Pipe { |