Reject produces only lines that do not contain the string s.
(s string)
| 816 | |
| 817 | // Reject produces only lines that do not contain the string s. |
| 818 | func (p *Pipe) Reject(s string) *Pipe { |
| 819 | return p.FilterScan(func(line string, w io.Writer) { |
| 820 | if !strings.Contains(line, s) { |
| 821 | fmt.Fprintln(w, line) |
| 822 | } |
| 823 | }) |
| 824 | } |
| 825 | |
| 826 | // RejectRegexp produces only lines that don't match the compiled regexp re. |
| 827 | func (p *Pipe) RejectRegexp(re *regexp.Regexp) *Pipe { |