Declaration redundancy
- Bool condition
Reports parts of boolean expressions that are either always true, always false, or redundant.
- Empty declaration
Reports empty declarations.
- Empty slice declared using a literal
Reports slice declarations with empty literal initializers used instead of nil.
- Redundant blank argument in range
Reports optional blank variables in range loops.
- Redundant comma
Reports commas that may be omitted in the end of argument lists and composite literals.
- Redundant import alias
Reports aliases of imported packages that may be omitted.
- Redundant second index in slices
Reports a redundant second index (a high bound) in slice expressions.
- Redundant semicolon
Reports redundant semicolons.
- Redundant type conversion
Reports type conversions that may be omitted.
- Redundant types in composite literals
Reports redundant type declarations in composite literals.
- Self assignment
Reports expressions that are assigned to themselves.
- Type can be omitted
Reports types in variable and constant declarations that can be omitted since they can be inferred by the compiler.
- Unused constant
Reports constants that are defined but are never used in code.
- Unused exported function
Reports unused exported functions.
- Unused exported type
Reports unused exported types in the main package and in tests.
- Unused function
Reports unused unexported functions.
- Unused global variable
Reports global variables that are defined but are never used in code.
- Unused parameter
Reports unused function parameters.
- Unused type
Reports unused types.
- Unused type parameter
Reports unused type parameters.