Perhaps the rule could be clarified by saying both "brands" and "nested acronyms or abbreviations". Since "OAuth" is an abbreviation, smash all uppercase. It also works for SMTPEnvelope -> smtpEnvelope (abbreviation). And SonicWallClient -> sonicwallClient (brand).
@kylev Hmm, I don't think I need to cover acronyms/abbreviations, since that's already covered by https://github.com/golang/go/wiki/CodeReviewComments#initialisms. This suggestion is really meant about brand names, like gRPC, OAuth, GitHub, SonicWall.
SMPTEnvelope
just follows the https://github.com/golang/go/wiki/CodeReviewComments#initialisms rule.
Does that make sense?
(Also, brand names that don't begin with a capital letter, but have capital letters elsewhere, are pretty hard to deal with... I'm still not sure what's the best way.)
Do this:
Don't do this:
Lowercase all letters, not only the first letter, of the first word when you want to make an unexported version.
For consistency with what the Go project does, and because it looks nicer.
oAuth
is not pretty.