How to set up debugging in GoLand?

前端 未结 6 618
北荒
北荒 2021-02-07 04:20

I am trying out GoLand and hear that the debugger is supposedly awesome, but I can’t find any documentation explaining how to set it up (GoLand is in preview stage, so that’s no

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 05:11

    Things changed in goland since @Jamillo Santos added his reply.

    To start with, there's no more "Go Application".

    The easiest way is to locate the file containing the main() function. There should be a small triangle pointing to it, like in the attached screenshot:

    When you click on the small green triangle, you get a menu with Run/Debug options. Each will create a go build configuration.

    You can edit that go build configuration and add the program arguments for your application. For example, if your program have a command line argument of --arg=value you can add it like this:

提交回复
热议问题