Go Style: Difference between revisions
Jump to navigation
Jump to search
(→Naming) |
(→Naming) |
||
Line 15: | Line 15: | ||
[[Go_Language#Identifiers_.28Names.29|Identifiers]] should use camel case: <code>SomeColor</code> or <code>someColor</code>. Do not use snake case (<code>some_color</code>). | [[Go_Language#Identifiers_.28Names.29|Identifiers]] should use camel case: <code>SomeColor</code> or <code>someColor</code>. Do not use snake case (<code>some_color</code>). | ||
Naming conventions: | |||
* [[Go_Language_Modularization#Idiomatic_Package_Naming_Conventions|Idiomatic Package Naming Conventions]]. |
Revision as of 18:03, 6 September 2023
External
- https://google.github.io/styleguide/go/
- https://go.dev/doc/effective_go
- https://github.com/golang/go/wiki/CodeReviewComments
Internal
Overview
The Go standard library is a good source of code examples, comments and style.
Naming
Naming is one of the most important aspects of Go development. Writing idiomatic Go requires understanding of its core naming principles.
Identifiers should use camel case: SomeColor
or someColor
. Do not use snake case (some_color
).
Naming conventions: