Inspectopedia
 
2024.3

Name starts with a package name

Info
Code Style
New
Last modified: 03 December 2024

Reports exported names that start with a package name. This inspection does not report such names in the main package.

Example:

The MyPackageGetIP name will be highlighted as it starts with the package name.

According to Package Names at github.com/golang, all references to names in a package will be done using the package name, so one can omit that name from the identifiers. For example, if you are in a package foo, you do not need a type FooFile, which clients will write as foo.FooFile. Instead, we name the type File, which clients will write as foo.File.