我在使用go exec包时遇到了麻烦。
我收到此错误:
package main
import (
"os/exec"
"fmt"
)
func main() {
var CMD string = "\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" C:\\Users\\User\\Desktop\\Guess.py"
//var CMD string = `"C:\Program Files\Sublime Text 3\sublime_text.exe" C:\Users\User\Desktop\Guess.py`
ExecCMD := exec.Command("cmd", "/C", CMD)
out, _ := ExecCMD.CombinedOutput()
fmt.Println(string(out))
}
当我尝试在Windows机器上的golang中运行此代码时:
autoreleasepool