check

package
v0.0.0-...-7ad9dbc Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnusedParams

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

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

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

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

func (*Checker) CallgraphAlgorithm

func (c *Checker) CallgraphAlgorithm(algo string)

CallgraphAlgorithm supplies Checker with the call graph construction algorithm.

func (*Checker) Check

func (c *Checker) Check() ([]lint.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) Program

func (c *Checker) Program(lprog *loader.Program)

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