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

Method Tee

script.go:947–953  ·  view source on GitHub ↗

Tee copies the pipe's contents to each of the supplied writers, like Unix tee(1). If no writers are supplied, the default is the pipe's standard output.

(writers ...io.Writer)

Source from the content-addressed store, hash-verified

945// tee(1). If no writers are supplied, the default is the pipe's standard
946// output.
947func (p *Pipe) Tee(writers ...io.Writer) *Pipe {
948 teeWriter := p.stdout
949 if len(writers) > 0 {
950 teeWriter = io.MultiWriter(writers...)
951 }
952 return p.WithReader(io.TeeReader(p.Reader, teeWriter))
953}
954
955// Wait reads the pipe to completion and returns any error present on
956// the pipe, or nil otherwise. This is mostly useful for waiting until

Calls 1

WithReaderMethod · 0.95