var Debug … var ( CPUProfile … MemProfile … Trace … ) var IncludeTests … var Fix … // RegisterFlags registers command-line flags used by the analysis driver. func RegisterFlags() { … } // Run loads the packages specified by args using go/packages, // then applies the specified analyzers to them. // Analysis flags must already have been set. // Analyzers must be valid according to [analysis.Validate]. // 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. func Run(args []string, analyzers []*analysis.Analyzer) int { … } // printDiagnostics prints diagnostics in text or JSON form // and returns the appropriate exit code. func printDiagnostics(graph *checker.Graph) (exitcode int) { … } // load loads the initial packages. Returns only top-level loading // errors. Does not consider errors in packages. func load(patterns []string, allSyntax bool) ([]*packages.Package, error) { … } // applyFixes applies suggested fixes associated with diagnostics // reported by the specified actions. It verifies that edits do not // conflict, even through file-system level aliases such as symbolic // links, and then edits the files. func applyFixes(actions []*checker.Action) error { … } // validateEdits returns a list of edits that is sorted and // contains no duplicate edits. Returns the index of some // overlapping adjacent edits if there is one and <0 if the // edits are valid. func validateEdits(edits []diff.Edit) ([]diff.Edit, int) { … } // diff3Conflict returns an error describing two conflicting sets of // edits on a file at path. func diff3Conflict(path string, xlabel, ylabel string, xedits, yedits []diff.Edit) error { … } // needFacts reports whether any analysis required by the specified set // needs facts. If so, we must load the entire program from source. func needFacts(analyzers []*analysis.Analyzer) bool { … } func dbg(b byte) bool { … }