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

Function ExamplePipe_EachLine

script_test.go:2322–2330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2320}
2321
2322func 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
2332func ExamplePipe_Echo() {
2333 script.NewPipe().Echo("Hello, world!").Stdout()

Callers

nothing calls this directly

Calls 3

FileFunction · 0.92
StdoutMethod · 0.80
EachLineMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…