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

Method WithStderr

script.go:1003–1008  ·  view source on GitHub ↗

WithStderr sets the standard error output for [Pipe.Exec] or [Pipe.ExecForEach] commands to w, instead of the pipe.

(w io.Writer)

Source from the content-addressed store, hash-verified

1001// WithStderr sets the standard error output for [Pipe.Exec] or
1002// [Pipe.ExecForEach] commands to w, instead of the pipe.
1003func (p *Pipe) WithStderr(w io.Writer) *Pipe {
1004 p.mu.Lock()
1005 defer p.mu.Unlock()
1006 p.stderr = w
1007 return p
1008}
1009
1010// WithStdout sets the pipe's standard output to the writer w, instead of the
1011// default [os.Stdout].

Calls

no outgoing calls