Gogland use-very simple view of the Go Language source code full picture!

Source: Internet
Author: User

The go language also supports object-oriented development, but unlike the object-oriented development we used in the past, the Go language proposition combines the concept of a class, in the go language, the structure plays a big role, if the structure of the combination of fields and methods, then simply in the source code, it is really time-consuming and laborious, Especially look at the code written by others, for example:

Type rawconnection struct {id       deviceidname     stringreceiver MODELCR *COUNTINGREADERCW *countingwriterawaiting    Map[int32]chan asyncresultawaitingmut Sync. Mutexidxmut sync. Mutex//ensures serialization of Index Callsnextid    int32nextidmut sync. Mutexoutbox      Chan asyncmessageclosed      chan struct{}once        sync. Oncepool        bufferpoolcompression Compression}

This rawconnection is a structure, at the same time it also defines a lot of methods, if only in the source code inside the view, really let you dizzy, I just looked at rawconnection time, looked at half a day, did not fully understand it, but when I opened Gogland " Structure "time, really have to praise Gogland, did great, immediately complete the rawconnection, including all of its fields and methods, so I can quickly complete understanding rawconnection!! Gogland by default, "Structure" does not seem to open, if not open, we can click on the top menu to open: "View", "Tools Windows", "Structure", or through the shortcut key "Alt+7" Open it.

View the overall structure of the rawconnection through "Structure", this structure of the whole picture, great!!

Gogland use-very simple view of the Go Language source code full picture!

Related Article

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.