环境是win10
在编译时出现 could not launch process: not an executable file
在环境变量 要改成 GOOS= windows
我把我的launch.json 发出来
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${fileDirname}",
"env": { //环境变量
"GOPATH":"E:/GoLand/GOPATH",
"GOOS":"windows" //要编译成win
},
"args": [],
"showLog": true
}
vscode 不是帮你考虑在调试时的编译改成windows 需要自己修改