2017-10-19 20:24 阅读 49


When I try to launch a Go Application in debug mode, Gogland takes a considerable amount of time to launch it. This can take several minutes, and happens on each launch even if there has been no code change.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    doufuxi7093 doufuxi7093 2017-10-19 20:24

    The problem is that Gogland forces a rebuild on each debug invocation. So if you have a lot of dependencies, it will be very slow.

    The solution is to go in to Settings > Build, Execution, Deployment > Debugger and disable Rebuild transitive packages. This will speed up debug launches by 20x (90s vs 5s).

    You should create a Go Application target labeled "Complete rebuild" and set the Go Tool Arguments to be -i -a. This will force a debug rebuild and store the intermediate products to speed up future builds.

    However, this means your cached and optimized, thus without proper debugging information, packages can be used in the debugger which means that it will affect your debugging experience. If you have any issues with the debugger you will need to run with -a first and see if the problem happens again.

    点赞 评论 复制链接分享