MCPcopy Index your code
hub / github.com/coder/coder / Capture

Function Capture

cli/clitest/golden.go:147–152  ·  view source on GitHub ↗

Capture sets up stdout and stderr writers on the invocation that prefix each line with "out: " or "err: " while preserving their order.

(inv *serpent.Invocation)

Source from the content-addressed store, hash-verified

145// Capture sets up stdout and stderr writers on the invocation that prefix each
146// line with "out: " or "err: " while preserving their order.
147func Capture(inv *serpent.Invocation) *Output {
148 output := &Output{}
149 inv.Stdout = &prefixWriter{mu: &output.mu, prefix: "out: ", raw: &output.stdout, combined: &output.combined}
150 inv.Stderr = &prefixWriter{mu: &output.mu, prefix: "err: ", raw: &output.stderr, combined: &output.combined}
151 return output
152}
153
154// Golden returns the formatted output with lines prefixed by "err: " or "out: ".
155func (o *Output) Golden() []byte {

Callers 7

TestExpTaskResumeFunction · 0.92
TestSecretCreateFunction · 0.92
TestSecretUpdateFunction · 0.92
TestSecretListFunction · 0.92
TestSecretDeleteFunction · 0.92
Test_TaskLogs_GoldenFunction · 0.92
TestExpTaskPauseFunction · 0.92

Calls

no outgoing calls

Tested by 7

TestExpTaskResumeFunction · 0.74
TestSecretCreateFunction · 0.74
TestSecretUpdateFunction · 0.74
TestSecretListFunction · 0.74
TestSecretDeleteFunction · 0.74
Test_TaskLogs_GoldenFunction · 0.74
TestExpTaskPauseFunction · 0.74