MCPcopy Create free account
hub / github.com/google/gapid / ExampleSilent

Function ExampleSilent

core/os/shell/command_example_test.go:36–45  ·  view source on GitHub ↗

This example shows how to run a command, wait for it to complete and check if it succeeded.

()

Source from the content-addressed store, hash-verified

34
35// This example shows how to run a command, wait for it to complete and check if it succeeded.
36func ExampleSilent() {
37 ctx := newCtx()
38 err := shell.Command("echo", "Hello from the shell").Run(ctx)
39 if err != nil {
40 log.F(ctx, true, "Unable to say hello: %v", err)
41 }
42 log.I(ctx, "Done")
43 // Output:
44 //I: [Example] Done
45}
46
47// This example shows how to run a command, with it's standard out and error being logged.
48func ExampleVerbose() {

Callers

nothing calls this directly

Calls 5

FMethod · 0.80
IMethod · 0.80
newCtxFunction · 0.70
RunMethod · 0.65
CommandMethod · 0.65

Tested by

no test coverage detected