Golang
Go Code Review Comments
https://github.com/golang/go/wiki/CodeReviewCommentshttps://google.github.io/styleguide/go/decisions#variable-nameshttps://www.cnblogs.com/xuweiqiang/p/15337132.htmlGood code specification is conducive to code maintenance. Since the specification requires too many requirements, the mandatory code specification is simplified into the following points:
All exported methods, exported custom structures or interfaces need to be annotated.
Logically complex areas require comments, the more detailed the better
Each row cannot exceed 120 columns
Each function cannot exceed 80 lines
The same file cannot exceed 800 lines
Cyclomatic complexity cannot exceed 15
The nesting depth cannot exceed 4 levels.
Code must be formatted with gofmt
Follow naming conventions (including variables, constants, etc.)
If the magic number appears more than 3 times, usage is prohibited.
notes:Please use English for all commentsThe above 10 points are mandatory requirements, but we encourage everyone to follow the code specifications as much as possibleI recommend installing golangci-lint locally and running checks before each code submission. Only proceed with the submission if it passes the checks.
Framework - GoFrame
https://goframe.org/pages/viewpage.action?pageId=1114119advantage:
Leading in the industry and complete in engineering
Modular, loosely coupled design, high performance
Rich in components (It covers almost all the components that can be used in backend development.), ready to use out of the box.
Simple and user-friendly, with detailed documentation
Interfacing and high scalability design
Full end-to-end tracing capability.
Full error stack trace feature.
Interface-based error code support.
Robust engineering design standards (helpful for beginners to develop good coding habits, learn advanced design principles, and facilitate better project maintenance)."
More convenient and powerful ORM components
Convenient development tools and automated code generation
Support OpenTelemetry observability standard
Automated interface document generation, supporting OpenAPIV3 standard
Engineering design is very suitable for language transformation such as PHP and JAVA
Disadvantage: The document is in Chinese and requires translation software
Last updated