Goland: AutoStart Delve


I used to program in PHP using PHPStorm and its Xdebug Integration is awesome, with auto-start, remote debug, listen connections, etc.

I cannot see some of the options in Goland:

 - Listen connections, the phone button is missing.

 - AutoStart

I am using delve, and if I create a debug config I see the following text:

"Before running this configuration, please start Delve with your application properly:
dlv debug --headless --listen=:2345 --api-version=2
go build -gcflags='-N -l' github.com/app/demo &&  dlv --listen=:2345 --headless=true --api-version=2 exec ./demo"

The question is... there is any way or tip to listen all incoming connections (like the phone button at PhpStorm) or at least, to autostart the debugger in the background when clicking the debug button?

Although it works, having to start delve before doing any debugging like this:

../../../../bin/dlv debug --headless --listen=:2345 --api-version=2
API server listening at: [::]:2345

Is tedious.

Do you recommend GDB? Does it have better features/integration?

Thanks in advance,


Comment actions Permalink

Hi David,

It doesn't make any sense to me. If you need to run the application on the local same machine, you can create Go Application run configuration and debug it. You don't need Go Remote debug at all.

If you need a remote debug, then `../../../bin/dlv debug ....` is not enough to run the application on the remote machine.

> Do you recommend GDB? Does it have better features/integration?

GoLand doesn't support GDB.

Comment actions Permalink

Sorry for the noobness. I'm just starting with this.

What would be the way to debug for example, inside a docker container?

Comment actions Permalink

I just didn't get the question, sorry if it was sounded offensive.

For running inside Docker you need Go Remote indeed, and you have to run an application with a debugger inside Docker container before running Go Remote.

At the moment GoLand can't run application inside Docker container. If you have any thoughts what GoLand should do about it and how it should do it, please share them here or in the corresponding issue: https://youtrack.jetbrains.com/issue/GO-3322. For now ,I don't understand how it could do it by running "../../bin/dlv debug... etc.".

Comment actions Permalink

I know it’s an old thread but the issue is still there. The other use case for running Remote debug locally is to have binaries built through some other process, not go build. For example, our project includes photo files and uses bazel to build binaries. Go build just doesn’t work. Would be nice if we either could debug binary directly (like VSCode does) or at least, launch delve from inside ide


Please sign in to leave a comment.