()
| 2608 | } |
| 2609 | |
| 2610 | func ExamplePipe_Tee_writers() { |
| 2611 | buf1, buf2 := new(bytes.Buffer), new(bytes.Buffer) |
| 2612 | s, err := script.Echo("hello\n").Tee(buf1, buf2).String() |
| 2613 | if err != nil { |
| 2614 | panic(err) |
| 2615 | } |
| 2616 | fmt.Print(s) |
| 2617 | fmt.Print(buf1.String()) |
| 2618 | fmt.Print(buf2.String()) |
| 2619 | // Output: |
| 2620 | // hello |
| 2621 | // hello |
| 2622 | // hello |
| 2623 | } |
| 2624 | |
| 2625 | func ExamplePipe_WithStderr() { |
| 2626 | buf := new(bytes.Buffer) |