checker

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package checker defines the implementation of the checker commands. The same code drives the multi-analysis driver, the single-analysis driver that is conventionally provided for convenience along with each analysis package, and the test driver.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Debug is a set of single-letter flags:
	//
	//	f	show [f]acts as they are created
	// 	p	disable [p]arallel execution of analyzers
	//	s	do additional [s]anity checks on fact types and serialization
	//	t	show [t]iming info (NB: use 'p' flag to avoid GC/scheduler noise)
	//	v	show [v]erbose logging
	//
	Debug = os.Getenv("GL_DEBUG_GO_ANALYSIS")

	// Log files for optional performance tracing.
	CPUProfile, MemProfile, Trace string
)

Functions

func NeedFacts

func NeedFacts(analyzers []*analysis.Analyzer) bool

NeedFacts reports whether any analysis required by the specified set needs facts. If so, we must load the entire program from source.

Types

type Diagnostic

type Diagnostic struct {
	analysis.Diagnostic
	AnalyzerName string
	Position     token.Position
}

func Run

func Run(analyzers []*analysis.Analyzer, initialPackages []*packages.Package) ([]Diagnostic, []error)

Run loads the packages specified by args using go/packages, then applies the specified analyzers to them. Analysis flags must already have been set. It provides most of the logic for the main functions of both the singlechecker and the multi-analysis commands. It returns the appropriate exit code.

Jump to

Keyboard shortcuts

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