Aller au contenu

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.

func ParseConfig(raw []byte) (*config, error) { // accidentally exported
return decode(raw)
}
func parseConfig(raw []byte) (*config, error) {
return decode(raw)
}

Lowercase the first letter so the identifier stays package-private.