This is a created article in which the information may have evolved or changed.
1. Go command (build, install, test, quick skip)
2. CGO (call C code)
Import "C" before storing the annotated C code. Refer to https://golang.org/cmd/cgo/for details. Use the CGO command to add c compile options, such as//#cgo ldflags:-l/go/src/foo/libs-lfoo.
3. Vendor (Vendor directory)
The third-party libraries used by the project are placed in the vendor directory to prevent conflicts between different versions of the project. Solve multi-project multi-version conflicts of third-party libraries. Does not address third-party library versioning and automatic update issues, using the Govendor library.
4. configuration file (JSON config)
Configuration file definition
Configuration files, such as server.conf:
JSON configuration file
When used:
Parsing the configuration file
5. Log library (Seelog)
Third-party library Seelog: Support synchronous/asynchronous (Get frequency: loop, timing, adaptive), support rich output level, format, terminal and color, support file filtering of different level log, support log file rollback, support dynamic update logger settings.
Implements the custom format Log:runtime. Caller (1) Returns the full file pathname and line number where the calling function is located, and adds a prefix log. Setprefix (); Os. Getpid () Get PID and so on.
6. Web Framework (Beego, Iris,martini, etc.)
Beego uses mvc+orm+restful, complete components, easy to use, suitable for simple small and medium Web server, the framework is bloated, performance is not high.
MVC: The main web interface, not a small talk. M:model, data Model, general Mapping database table; V:view, view, generally generated by template, placeholder on the page, back-end code only need to fill data to placeholder, C:controller, controller, connect page View and backend database Model, Implement the control logic.