MCPcopy
hub / github.com/bitfield/script / CountLines

Method CountLines

script.go:283–288  ·  view source on GitHub ↗

CountLines returns the number of lines of input, or an error.

()

Source from the content-addressed store, hash-verified

281
282// CountLines returns the number of lines of input, or an error.
283func (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.
291func (p *Pipe) DecodeBase64() *Pipe {

Calls 3

FilterScanMethod · 0.95
ErrorMethod · 0.95
WaitMethod · 0.80