Go Style: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
Naming conventions:
Naming conventions:
* [[Go_Language_Modularization#Idiomatic_Package_Naming_Conventions|Idiomatic Package Naming Conventions]].
* [[Go_Language_Modularization#Idiomatic_Package_Naming_Conventions|Idiomatic Package Naming Conventions]].
* [[Go_Language#Idiomatic_Variable_Naming_Conventions|Idiomatic Variable Naming Conventions]]
* [[Go_Functions#Idiomatic_Function_Naming_Conventions|Idiomatic Function Naming Conventions]]
* [[Go_Structs#Idiomatic_Struct_Naming_Conventions|Idiomatic Struct Naming Conventions]]

Revision as of 18:49, 6 September 2023

External

Internal

Overview

The Go standard library is a good source of code examples, comments and style.

Naming

https://google.github.io/styleguide/go/guide#mixedcaps

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: