Match produces only the input lines that contain the string s.
(s string)
| 787 | |
| 788 | // Match produces only the input lines that contain the string s. |
| 789 | func (p *Pipe) Match(s string) *Pipe { |
| 790 | return p.FilterScan(func(line string, w io.Writer) { |
| 791 | if strings.Contains(line, s) { |
| 792 | fmt.Fprintln(w, line) |
| 793 | } |
| 794 | }) |
| 795 | } |
| 796 | |
| 797 | // MatchRegexp produces only the input lines that match the compiled regexp re. |
| 798 | func (p *Pipe) MatchRegexp(re *regexp.Regexp) *Pipe { |