如图,进度条总是处于滑动状态,始终无法启动程序:
解决办法:
将文件单独拷贝至新的目录,只有一个go文件,重新创建launch.json,会生成.vscode目录
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
}
此时debug启动文件,成功。
![](https://img2020.cnblogs.com/blog/988812/202107/988812-20210709085316228-13059607.png)
原因估计是因为文件在嵌套目录,导致找不到对应的launch.json文件,所以始终无法启动。