staticlint

package
v0.0.0-...-c2add7f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 41 Imported by: 0

Documentation

Overview

Package staticlint implements multichecker static analyser with different linters. The packages uses golang.org/x/tools/go/analysis/multichecker under the hood to combine different linters in unified and convenient utility.

Staticlint includes the following linters:

From golang.org/x/tools/go/analysis/passes: assign, atomic, atomicalign, bools, composite, copylock, deepequalerrors, directive, errorsas, httpresponse, ifaceassert, loopclosure, lostcancel, nilfunc, nilness, reflectvaluecompare, shadow, shift, sigchanyzer, sortslice, stdmethods, stringintconv, structtag, tests, timeformat, unmarshal, unreachable, unsafeptr, unusedresult, unusedwrite.

For additional details regarding particular linter please refer to: https://pkg.go.dev/golang.org/x/tools/go/analysis/passes

From staticheck.io:

  • All SA* (staticcheck) linters.
  • All S* (simple) linters.
  • All ST* (stylecheck) linters.
  • All QF* (quickfix) linters.

For additional details regarding particular linting group please refer to: https://staticcheck.io/docs/checks/

Other publicly available linters:

Custom linters:

  • noexit to check whether os.Exit is used in the main function of the main package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StaticLint

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

StaticLint is umbrella structure for collection of linters passed to golang.org/x/tools/go/analysis/multichecker.

func New

func New() StaticLint

New initializes new instance of StaticLint linter.

func (StaticLint) Run

func (s StaticLint) Run()

Run launches the linters against provided source code.

Jump to

Keyboard shortcuts

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