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