Hope I can explain this right.
Update: I can confirm that dlv debug -l 127.0.0.1:2345
does work.
Therefore I must be in VsCode launch.json
I figured out my problem by adding the "trace" option to the launch.json
(in VS Code)
{
"name": "Attach remote ",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "/home/me/goprojects/src/github.com/owner/project/package",
"port": 2345,
"host": "xxxx.xyz",
"trace":"log",
}
Doing that revealed in the Debug Console that it was looking for the source file with the wrong path. I realised that remotePath
in the launch.json
should be (for my setup at least) just /home/me/goprojects/src/github.com/owner/project
So, try adding trace and scrutinize the Debug Console