Created
June 4, 2022 16:39
-
-
Save suhlig/09f9f3a3a817a376889d1c70dd0d4cad to your computer and use it in GitHub Desktop.
Use VS Code to debug a go program that is running externally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see also https://github.com/go-delve/delve/tree/master/Documentation/api/dap | |
go build -o plaintweet-darwin \ | |
&& dlv exec --headless --log --api-version 2 --listen localhost:42353 -- ./plaintweet-darwin serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Attach to Process", | |
"type": "go", | |
"request": "attach", | |
"mode": "remote", | |
"apiVersion": 2, | |
"port": 42353 | |
}, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For vim, this would be
:GoDebugConnect :42353
see Vim, Go and Remote Debugging