在我的Windows计算机上,我安装了Visual Studio代码.要手动运行测试,我在控制台中转到Projects文件夹,然后输入
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
你知道为什么会发生这个错误吗?它在寻找什么可执行文件?