Skip to content

Instantly share code, notes, and snippets.

@suhlig
Created July 15, 2025 13:52
Show Gist options
  • Save suhlig/4812cd2531928220a3846f5ec0f43bfc to your computer and use it in GitHub Desktop.
Save suhlig/4812cd2531928220a3846f5ec0f43bfc to your computer and use it in GitHub Desktop.
Running delve for cli and ginkgo tests
# if there is a main.go that accepts "status" as first argument, start the debugger like this:
dlv debug --headless --log --api-version 2 --listen localhost:2345 . -- status
# if there is a Ginkgo test in the foo directory (package example.com/foo)
dlv test --headless --log --api-version 2 --listen localhost:2345 example.com/foo
{
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "${workspaceFolder}",
"port": 2345,
"host": "127.0.0.1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment