lint

package
v0.49.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnusedParam = &analysis.Analyzer{
	Name: "unusedparam",
	Doc:  "report unused parameters that should be unnamed, or blank when the list keeps its names",
	Run:  runUnusedParam,
}

UnusedParam reports parameters a function never references, and says how to spell them by whether any parameter is used at all.

Go requires a parameter list to be either wholly named or wholly unnamed, so the two cases differ. When every parameter goes unused the whole list can drop its names and stand as types alone, which is both shorter and more honest than a row of blank identifiers. When some parameters are used the list must stay named, and the blank identifier is then the only way to mark the rest as ignored.

View Source
var UnusedRecv = &analysis.Analyzer{
	Name: "unusedrecv",
	Doc:  "report method receivers that go unused and should therefore be unnamed",
	Run:  runUnusedRecv,
}

UnusedRecv reports a method that names a receiver it never references.

Go lets a receiver be declared by type alone, and that spelling states the fact directly: the method does not read what it is called on. Any name invites the reader to look for a use that is not there, and the blank identifier is no better — it spends a slot saying "ignored" where saying nothing is available.

Functions

func Analyzers

func Analyzers() []*analysis.Analyzer

Analyzers returns every rule vef-lint enforces.

Registering a rule here is all a new one needs: multichecker derives the command line from each Analyzer's Name, so every rule can be run, skipped, or applied with -fix on its own without any wiring of its own.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL