MCPcopy
hub / github.com/TomWright/dasel / runDasel

Function runDasel

internal/cli/command_test.go:13–28  ·  view source on GitHub ↗
(args []string, in []byte)

Source from the content-addressed store, hash-verified

11)
12
13func runDasel(args []string, in []byte) ([]byte, []byte, error) {
14 stdOut := bytes.NewBuffer([]byte{})
15 stdErr := bytes.NewBuffer([]byte{})
16 stdIn := bytes.NewReader(in)
17
18 originalArgs := os.Args
19 defer func() {
20 os.Args = originalArgs
21 }()
22
23 os.Args = append([]string{"dasel", "query"}, args...)
24
25 _, err := cli.Run(stdIn, stdOut, stdErr)
26
27 return stdOut.Bytes(), stdErr.Bytes(), err
28}
29
30type testCase struct {
31 args []string

Callers 1

runTestFunction · 0.85

Calls 2

RunFunction · 0.92
NewReaderMethod · 0.80

Tested by

no test coverage detected