String returns the pipe's contents as a string, together with any error.
()
| 934 | |
| 935 | // String returns the pipe's contents as a string, together with any error. |
| 936 | func (p *Pipe) String() (string, error) { |
| 937 | data, err := p.Bytes() |
| 938 | if err != nil { |
| 939 | p.SetError(err) |
| 940 | } |
| 941 | return string(data), p.Error() |
| 942 | } |
| 943 | |
| 944 | // Tee copies the pipe's contents to each of the supplied writers, like Unix |
| 945 | // tee(1). If no writers are supplied, the default is the pipe's standard |