MCPcopy
hub / github.com/danielmiessler/Fabric / captureInput

Function captureInput

internal/plugins/plugin_test.go:289–298  ·  view source on GitHub ↗

captureInput captures the input for a function call

(input string)

Source from the content-addressed store, hash-verified

287
288// captureInput captures the input for a function call
289func captureInput(input string) func() {
290 r, w, _ := os.Pipe()
291 _, _ = w.WriteString(input)
292 _ = w.Close()
293 stdin := os.Stdin
294 os.Stdin = r
295 return func() {
296 os.Stdin = stdin
297 }
298}

Callers 2

TestSetupQuestion_AskFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected