MCPcopy Create free account
hub / github.com/Shopify/goose / ExampleBuilder_WithEnv

Function ExampleBuilder_WithEnv

shell/shell_test.go:51–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func ExampleBuilder_WithEnv() {
52 ctx := context.Background()
53 stdout, _, _ := NewBuilder(ctx, "bash", "-c", "echo -n $foo").
54 WithEnv(Env{"foo": "bar"}).
55 Prepare().
56 RunAndGetOutput()
57
58 fmt.Println(string(stdout))
59 // Output:
60 // bar
61}
62
63func TestCommandRunWait(t *testing.T) {
64 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

NewBuilderFunction · 0.85
RunAndGetOutputMethod · 0.65
PrepareMethod · 0.65
WithEnvMethod · 0.65

Tested by

no test coverage detected