Jump to content

Naming conventions: Difference between revisions

→‎{{header|Go}}: Reworded point 3 which wasn't entirely accurate previously.
(Added Go)
(→‎{{header|Go}}: Reworded point 3 which wasn't entirely accurate previously.)
Line 551:
2. Names of all other entities should be either 'mixedCaps' or 'MixedCaps' (no underscores).
 
3. Names which are privateexported tofrom a package (i.e. public names) must begin with aan lowerupper case letter and be declared either at 'top level' within the package or be field or method names. whichAll other names are not exported mustand beginhence withare anprivate upperto casethe letterpackage. This is not a convention, it is an obligatory part of the language.
 
4. If a struct has a private field, 'owner' say, public access to which is via by a getter and/or setter method, then the former should use the style Owner() and the latter SetOwner().
9,488

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.