This is a created article in which the information may have evolved or changed.
1 Golang Self-development Project Introduction Package
You need to create a project under $GOPATH/SRC, such as interactive, to introduce your own package such as import interactive/notify
2nd Log Library
Beego/logs
3 Golang Development FAQs
3.1 Current working directory for file paths and commands
The file relative path is for the current working directory of the Golang process, the unit test is in a different directory, so the relative working directory of the unit test is not the same, how to ensure the validity of the file path?
4 Golang relationship between the blocking and kernel threads
In addition to the number of threads used by the Golang process (using the Gomaxprocs parameter control), there are additional threads. When the process is blocked in a system call, additional threads are generated and consumed, and these threads do not include gomaxprocs threads that are occupied by the coprocessor.
When the process is blocked in the following system calls will not generate or occupy additional threads, when Ctrip will be swapped out, the co-scheduler will execute other operating Ctrip. Such as
* Socket IO
* Sleeping
* Channel Operations
* Blocking on primitives in the SYSNC package.