Gogland:调试显示为灰色

Gogland:调试显示为灰色

问题描述:

I can't seem to get the debugger to run. The debugging run icon is grayed out and the menu options are missing.

Toolbar

This is only the case for main, I can debug unit tests just fine.

Similar questions mention the project structure, but I can't see anything wrong:

$GOPATH/src/foo.bar.com/some/more/dirs/
      project/    <-- this directory is opened in Gogland
         app1/
            main.go
         app2/
            main.go
         mylib/
            abc.go
            abc_test.go

I can right click on abc_test.go and run it with or without debugging, but if I right click on one of the main.go files, I can only run it.

Run configuration:

run configuration

Gogland build 162.12024.32

Go Single File does not currently support debugging. If such a Run Configuration is active then a new one must be created. The type for the new one must be Go Application.

To create a Go Application Run Configuration you can also choose: Build and run ... from the menu when presented with the option.

Also changing the current active Run Configuration from a Go Single File to a Go Application one will fix the problem.