lint: Index | Files | Directories

package lint

import ""

Package lint contains a linter for Go source code.


Package Files


type Linter Uses

type Linter struct {

A Linter lints Go source code.

func (*Linter) Lint Uses

func (l *Linter) Lint(filename string, src []byte) ([]Problem, error)

Lint lints src.

func (*Linter) LintFiles Uses

func (l *Linter) LintFiles(files map[string][]byte) ([]Problem, error)

LintFiles lints a set of files of a single package. The argument is a map of filename to source.

type Problem Uses

type Problem struct {
    Position   token.Position // position in source file
    Text       string         // the prose that describes the problem
    Link       string         // (optional) the link to the style guide for the problem
    Confidence float64        // a value in (0,1] estimating the confidence in this problem's correctness
    LineText   string         // the source line
    Category   string         // a short name for the general category of the problem

    // If the problem has a suggested fix (the minority case),
    // ReplacementLine is a full replacement for the relevant line of the source file.
    ReplacementLine string

Problem represents a problem in some source code.

func (*Problem) String Uses

func (p *Problem) String() string


golintgolint lints the Go source files named on its command line.

Package lint imports 16 packages (graph) and is imported by 21 packages. Updated 2020-12-08. Refresh now. Tools for package owners.