2
在我的Windows机器上,我安装了Visual Studio代码。要手动运行测试,我要在控制台中输入项目文件夹,然后输入在Visual Studio代码中调试Go测试
go test main_test.go
它完美地工作。
但我有我需要调试我的测试,以了解发生了什么情况。
为此,我打开launch.json和添加配置
{
"name": "Tests",
"type": "go",
"request": "launch",
"mode": "test",
"remotePath": "",
"port": 2346,
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [
"main_test.go"
],
"showLog": true
}
我按F5后,我有
2017/03/29 13:28:11 server.go:73: Using API v1
2017/03/29 13:28:11 debugger.go:68: launching process with args: [./debug.test main_test.go main_go]
not an executable file
Process exiting with code: 1
任何想法,为什么出现这种错误,什么可执行程序,它在寻找?
尝试指定与可执行文件中配置“程序”财产“$ {} workspaceRoot /main_test.go” – Bob
就是这样,谢谢! – Vitalii