- Indentation with tab in most cases
- Tab size 4 (i.e. indentation size is 4)
- Unix format (line ending with LF not CR LF)
- Be careful when you use Windows PC
- UTF-8 encoding
- No exe perm for source code files (go files)
- Be careful when you use Windows PC
- See
go fmt
- Use camelCase and CamelCase for Go
- Use
go fmt
before commit. This will enforce:- Indentation with tabs
- Alignment with blanks (= spaces)
- Order of imported packages
- Use camelCase for Javascript
- Use snake_case for JSON
- This also applies to field tags for members of a Go
struct
.
type MyStruct struct { MemberName string `json:"member_name"` }
- This also applies to field tags for members of a Go
- Use snake_case for RPC keywords