Reputation: 461
I am trying to debug a go application on VScode, but my config.json can't be found. I am getting a Error occurred while reading config. panic: open config.json: The system cannot find the file specified
error.
This is my launch.json file and I have my workspace path set to the src, which is where I have my go files and main package.
"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.sstatic.net/mz4KL.png
Upvotes: 0
Views: 1270
Reputation: 1078
Try this config
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
Upvotes: 0