Debug of Golang Learning

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.