(timeout time.Duration, name string, args ...string)
| 36 | } |
| 37 | |
| 38 | func RunCommandWithTimeoutAndGetOutput(timeout time.Duration, name string, args ...string) ([]byte, error) { |
| 39 | ctx, cancel := context.WithTimeout(context.Background(), timeout) |
| 40 | defer cancel() |
| 41 | |
| 42 | cmd := exec.CommandContext(ctx, name, args...) |
| 43 | return cmd.CombinedOutput() |
| 44 | } |
| 45 | |
| 46 | func EmptyFlags() map[string]string { |
| 47 | return map[string]string{} |