How can I call an external command in GO? I need to call an external program and wait for it to finish execution. before the next statement is executed.
You need to use the exec package : start a command using Command and use Run to wait for completion.
Run
cmd := exec.Command("yourcommand", "some", "args") if err := cmd.Run(); err != nil { fmt.Println("Error: ", err) }
If you just want to read the result, you may use Output instead of Run.