Clarification needed for single-word naming conventions in Go Style Guide
- Dominant language
- HTML
- Stars
- 39.6k
- Forks
- 12.9k
- Avg merge
- 42m
- Merged PRs (30d)
- 15
Description
https://github.com/google/styleguide/blob/1387bff19c141c047c483cbe813659625f93defa/go/guide.md?plain=1#L402-L412
The style guide explains that multi-word names in Go should use *MixedCaps* (camelCase) rather than underscores. For example:
- `MaxLength` (exported)
- `maxLength` (unexported)
However, the guide doesn’t clearly state what the convention is for **single-word names**.
Questions:
- Should single-word identifiers always be lowercase for unexported names (e.g., `count`, `user`)?
- Should exported single-word identifiers use leading uppercase (e.g., `Error`, `String`), similar to how the standard library does it?
This clarification would help newcomers understand whether there are any exceptions or additional rules for single-word names beyond the standard capitalization rules.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.