()
| 2320 | } |
| 2321 | |
| 2322 | func ExamplePipe_EachLine() { |
| 2323 | script.File("testdata/test.txt").EachLine(func(line string, out *strings.Builder) { |
| 2324 | fmt.Fprintln(out, ">", line) |
| 2325 | }).Stdout() |
| 2326 | // Output: |
| 2327 | // > This is the first line in the file. |
| 2328 | // > Hello, world. |
| 2329 | // > This is another line in the file. |
| 2330 | } |
| 2331 | |
| 2332 | func ExamplePipe_Echo() { |
| 2333 | script.NewPipe().Echo("Hello, world!").Stdout() |