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!