Package Naming Convention

ID

go.naming_package

Severity

info

Remediation Complexity

trivial

Remediation Risk

medium

Remediation Effort

low

Resource

Naming Convention

Language

Go

Tags

naming

Description

Reports package clauses whose name does not follow Go’s naming convention. Go package names should be short, all-lowercase single words — no underscores, no mixedCaps, no uppercase letters.

Rationale

A Go package name is a single identifier, not a dotted reverse-domain path. The community convention is a short, all-lowercase word (http, strconv, httputil) so that the name reads cleanly at every call site. Underscores and mixedCaps make package qualifiers noisy and inconsistent with the standard library, and uppercase letters blur the distinction between package qualifiers and exported identifiers.

// Bad
package myPackage   // mixedCaps
package my_package  // underscore

// Good
package httputil
package strconv

Remediation

Rename the package to a short, all-lowercase word. Keep it concise and avoid stutter with the import path (a package at …​/auth should be package auth, not package authpkg).