2019-01-21 02:52
采纳率: 0%
浏览 324


When debugging with Goland on macos, my program waits for input from stdin.

I can type in the console and press enter, but the input is not passed to my program.

It is just like typing in a text editor. I can type, press enter, delete everything I just did. My program gets none of this passed to it.

I also get this behavior when debugging with dlv from the console, however, I have found discussion on how to address it in that circumstance:


I see a similar fix for vscode as well:


But I could not find a solution for goland.

图片转代码服务由CSDN问答提供 功能建议

在macOS上使用Goland进行调试时,我的程序等待标准输入。 < p>我可以在控制台中键入内容,然后按Enter键,但是输入内容不会传递到我的程序中。

就像在文本编辑器中输入内容一样。 我可以键入,按Enter键,删除我刚做的所有事情。 我的程序没有将此传递给它。

在从控制台使用dlv进行调试时,我也得到了这种行为,但是,我发现了有关在这种情况下如何解决该问题的讨论: / p>

https:// github。 com / go-delve / delve / issues / 1274#issuecomment-406969034


https://github.com/Microsoft/vscode-go/issues / 219#issuecomment-192164367


  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongshang1934 2019-01-21 06:20

    This is a known issue, see the official issue tracker report for this.

    The workaround for it is to compile the application with the correct debugging flags, -gcflags="all=-N -l" for Go 1.10 or newer and -gcflags="-N -l" for Go 1.9 or older), launch the application in an OS terminal and then use the Attach to process... feature. You can also see the linked issue to see other possible workarounds.

    解决 无用
    打赏 举报

相关推荐 更多相似问题