Unexported camelCase (ARCH5002)
Ce contenu n’est pas encore disponible dans votre langue.
Key go.naming.unexported-camelcase · Severity warning · Category naming
Unexported (package-private) function names should start with a lowercase letter; an uppercase first letter accidentally exports them. This breaks the intended visibility and leaks the API surface.
Incorrect
Section titled “Incorrect”func ParseConfig(raw []byte) (*config, error) { // accidentally exported return decode(raw)}Correct
Section titled “Correct”func parseConfig(raw []byte) (*config, error) { return decode(raw)}Lowercase the first letter so the identifier stays package-private.