Run an example Go program, return the combined output as a string.
(t *testing.T, prog string, arg ...string)
| 130 | |
| 131 | // Run an example Go program, return the combined output as a string. |
| 132 | func runExample(t *testing.T, prog string, arg ...string) (string, error) { |
| 133 | cmd := exampleCommand(t, prog, arg...) |
| 134 | out, err := cmd.Output() |
| 135 | return string(out), err |
| 136 | } |
| 137 | |
| 138 | func prefix(prefix string, err error) error { |
| 139 | if err != nil { |
no test coverage detected