Executing commands:
*os.Exec pitfalls
exec.Cmd cannot be reused
An exec.Cmd cannot be reused after calling its Run, Output or CombinedOutput methods.
cmd := exec.Command("go", "version")
_, err := cmd.CombinedOutput()
if err != nil {
log.Fatalf("first cmd.CombintedOutput() failed with '%s'\n", err)
}
_, err = cmd.CombinedOutput()
if err != nil {
log.Fatalf("second cmd.CombintedOutput() failed with '%s'\n", err)
}
2020/07/12 07:36:21 second cmd.CombintedOutput() failed with 'exec: Stdout already set'
exit status 1