Zum Inhalt springen

Unexported camelCase (ARCH5002)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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.