(ctx context.Context, execer agentexec.Execer, cmd string, args ...string)
| 283 | } |
| 284 | |
| 285 | func run(ctx context.Context, execer agentexec.Execer, cmd string, args ...string) (stdout, stderr string, err error) { |
| 286 | var stdoutBuf, stderrBuf strings.Builder |
| 287 | execCmd := execer.CommandContext(ctx, cmd, args...) |
| 288 | execCmd.Stdout = &stdoutBuf |
| 289 | execCmd.Stderr = &stderrBuf |
| 290 | err = execCmd.Run() |
| 291 | stdout = strings.TrimSpace(stdoutBuf.String()) |
| 292 | stderr = strings.TrimSpace(stderrBuf.String()) |
| 293 | return stdout, stderr, err |
| 294 | } |
no test coverage detected