v0.0.0-...-8a5130c Latest Latest

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

Go to latest
Published: May 28, 2024 License: BSD-3-Clause Imports: 17 Imported by: 81



Package check implements the unparam linter. Note that its API is not stable.



This section is empty.


This section is empty.


func UnusedParams

func UnusedParams(tests, exported, debug bool, args ...string) ([]string, error)

UnusedParams returns a list of human-readable issues that point out unused function parameters.


type Checker

type Checker struct {
	// contains filtered or unexported fields

Checker finds unused parameters in a program. You probably want to use UnusedParams instead, unless you want to use a *loader.Program and *ssa.Program directly.

func (*Checker) Check

func (c *Checker) Check() ([]Issue, error)

Check runs the unused parameter check and returns the list of found issues, and any error encountered.

func (*Checker) CheckExportedFuncs

func (c *Checker) CheckExportedFuncs(exported bool)

CheckExportedFuncs sets whether to inspect exported functions

func (*Checker) Packages

func (c *Checker) Packages(pkgs []*packages.Package)

Program supplies Checker with the needed *loader.Program.

func (*Checker) ProgramSSA

func (c *Checker) ProgramSSA(prog *ssa.Program)

ProgramSSA supplies Checker with the needed *ssa.Program.

type Issue

type Issue struct {
	// contains filtered or unexported fields

Issue identifies a found unused parameter.

func (Issue) Message

func (i Issue) Message() string

func (Issue) Pos

func (i Issue) Pos() token.Pos

Jump to

Keyboard shortcuts

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