VScode 调试模式找不到我的 config.json 文件



我正试图在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}"
}
]

相关内容

  • 没有找到相关文章

最新更新