Ir al contenido

Unexported camelCase (ARCH5002)

Esta página aún no está disponible en tu idioma.

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.