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

Method Reject

script.go:818–824  ·  view source on GitHub ↗

Reject produces only lines that do not contain the string s.

(s string)

Source from the content-addressed store, hash-verified

816
817// Reject produces only lines that do not contain the string s.
818func (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.
827func (p *Pipe) RejectRegexp(re *regexp.Regexp) *Pipe {

Callers 2

ExamplePipe_RejectFunction · 0.80

Calls 1

FilterScanMethod · 0.95

Tested by 2

ExamplePipe_RejectFunction · 0.64