A helper to ignore os.Exit(1) errors when running a cobra Command
(root *cobra.Command, args ...string)
| 137 | |
| 138 | // A helper to ignore os.Exit(1) errors when running a cobra Command |
| 139 | func executeCommand(root *cobra.Command, |
| 140 | args ...string) (stdout string, err error) { |
| 141 | for i, arg := range args { |
| 142 | tInfo(fmt.Sprintf("(%d) %s", i, arg)) |
| 143 | } |
| 144 | // programs can exit with error here.. |
| 145 | stdout, _, err = executeCommandC(root, args...) |
| 146 | tInfo("The command successfully returned values for assertion.") |
| 147 | return stdout, err |
| 148 | } |
| 149 | |
| 150 | // A helper to ignore os.Exit(1) errors when running a cobra Command |
| 151 | func executeCommandC(root *cobra.Command, args ...string) (stdout string, output string, err error) { |
no test coverage detected