First of all, the previous contact with Java, recently need to contact the Golang, so the general will use the transfer of thinking, thinking of Debug debugging code, online Search a lot of information, we recommend are Golang integration tools, similar to gbd,delve such tools, But even if Golang itself does not have debug,ide, it is certainly integrated debug debugging
In Java programming, people using idea, should also use Golang (Spit Groove, editor and language name exactly the same, search problems, it is easy to search, ah ~), in fact, Golang and idea is the same, shortcut keys are basically the same,
See:
Screen shot 2018-07-31 a.m. 11.54.53.png
I was thinking about this place. Configure debug, general projects without configuration, right-click on the Main.go file debug select on it. If the project needs to run the entire package, not a single file, or the project is using the same case as my side, command-line-bank Cobra.
The online information says go application and I here go build is similar, I do not have go application here, may be different version (2018.1 latest version)
The most important is the configuration of two places
Screen shot 2018-07-31 pm 12.00.21.png
The run kind in this place can no longer select file (single files), select as needed
Screen shot 2018-07-31 pm 12.00.35.png
This place program arguments because I use the Cobra, in addition to go run main.go There are custom command parameters, you can add, pay attention to not space, shelf write, so you can use Run or debug start