mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Clarify the "ID" vs "id" argument
parent
46bba03133
commit
16b0973142
@ -335,7 +335,7 @@ if err != nil {
|
|||||||
|
|
||||||
Words in names that are initialisms or acronyms (e.g. "URL" or "NATO") have a consistent case. For example, "URL" should appear as "URL" or "url" (as in "urlPony", or "URLPony"), never as "Url". As an example: ServeHTTP not ServeHttp. For identifiers with multiple initialized "words", use for example "xmlHTTPRequest" or "XMLHTTPRequest".
|
Words in names that are initialisms or acronyms (e.g. "URL" or "NATO") have a consistent case. For example, "URL" should appear as "URL" or "url" (as in "urlPony", or "URLPony"), never as "Url". As an example: ServeHTTP not ServeHttp. For identifiers with multiple initialized "words", use for example "xmlHTTPRequest" or "XMLHTTPRequest".
|
||||||
|
|
||||||
This rule also applies to "ID" when it is short for "identifier", so write "appID" instead of "appId".
|
This rule also applies to "ID" when it is short for "Identity Document" (which is pretty much all cases when it's not the "id" as in "ego", "superego"), so write "appID" instead of "appId".
|
||||||
|
|
||||||
Code generated by the protocol buffer compiler is exempt from this rule. Human-written code is held to a higher standard than machine-written code.
|
Code generated by the protocol buffer compiler is exempt from this rule. Human-written code is held to a higher standard than machine-written code.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user