Gogland:调试功能被禁用。

huangapple go评论94阅读模式
英文:

Gogland: debugging is grayed out

问题

我似乎无法运行调试器。调试运行图标变灰,菜单选项也消失了。

这只发生在main函数上,我可以正常调试单元测试。

类似的问题提到了项目结构,但我看不出有什么问题:

$GOPATH/src/foo.bar.com/some/more/dirs/
      project/    <-- 这个目录在 Gogland 中已打开
         app1/
            main.go
         app2/
            main.go
         mylib/
            abc.go
            abc_test.go

我可以右键点击abc_test.go并运行它,带或不带调试,但如果我右键点击其中一个main.go文件,我只能运行它。

运行配置:

Gogland:调试功能被禁用。

Gogland 版本 162.12024.32

英文:

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

Gogland:调试功能被禁用。

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:

Gogland:调试功能被禁用。

Gogland build 162.12024.32

答案1

得分: 3

Go Single File目前不支持调试。如果存在此类运行配置,则必须创建一个新的运行配置。新运行配置的类型必须为Go应用程序。

要创建一个Go应用程序运行配置,您还可以在选择选项时从菜单中选择“构建并运行...”。

此外,将当前活动的运行配置从Go单个文件更改为Go应用程序运行配置将解决该问题。

英文:

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.

huangapple
  • 本文由 发表于 2017年3月13日 04:08:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/42752485.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定