doujian1954 2018-05-20 19:16
浏览 381
已采纳

在GoLand控制台中运行termbox-go应用

I want to create a Go app with a console UI using the termui library (which is built on top of the termbox-go library). I can build the app and run it from the command line, but it will not start inside the GoLand IDE (2018.1.3) on Windows 10.

It fails during the termbox-go init when calling syscall.Syscall with SetConsoleScreenBufferSize parameter. The size for the screen buffer is 80x25. Error message is just "The parameter is incorrect."

How can I debug a termbox-go app in the GoLand or other IDE?

  • 写回答

1条回答 默认 最新

  • dongyuan8024 2018-05-21 17:30
    关注

    I think the way to solve this is to build your executable with Go 1.10 or newer, compile it with the following flags: -gcflags="all=-N -l" (these are very important and will allow the debugger to work a lot better, and then use the Run | Attach to Local Process... option from GoLand and attach to the local process.

    I'll see if I can replicate the bug and update this accordingly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?
  • ¥15 关于#vue.js#的问题:修改用户信息功能图片无法回显,数据库中只存了一张图片(相关搜索:字符串)
  • ¥15 texstudio的问题,
  • ¥15 spaceclaim模型变灰色