Golang运行系统命令
库
# https://github.com/go-cmd/cmd
# 示例代码
func runCommand() {
// Create Cmd, buffered output
envCmd := cmd.NewCmd("./testmain.exe")
// Run and wait for Cmd to return Status
status := envCmd.Start()
// envCmd.Stop()
finalStatus := <-status
fmt.Println(finalStatus.Stdout)
// Print each line of STDOUT from Cmd
// for _, line := range status.Stdout {
// fmt.Println(line)
// }
}