Inspectopedia Help

Name starts with a package name

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

Example:

package myPackage func MyPackageGetIP() { }

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.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

GoNameStartsWithPackageName
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Go | Code style issues

Availability

By default bundled with

GoLand 2024.1, Qodana for Go 2024.1,

Can be installed with plugin

Go, 241.SNAPSHOT

Last modified: 18 June 2024