英文:
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 版本 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.
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 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论