我正试图在VScode上调试go应用程序,但找不到我的config.json。我收到一个Error occurred while reading config. panic: open config.json: The system cannot find the file specified
错误。
这是我的launch.json文件,我的工作区路径设置为src,在那里我有go文件和主包。
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceRoot}\src"
}
]
}```
The config.go file is a level higher than the src folder. I have attached a screenshot of my workspace structure. What am I doing wrong?
[![screenshot of my workspace structure][1]][1]
[1]: https://i.stack.imgur.com/mz4KL.png
尝试此配置
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]