Documentation ¶
Overview ¶
Package check implements binary analysis similar to bazel's nogo, or the unitchecker package. It exists in order to provide additional facilities for analysis, namely plumbing through the output from dumping the generated binary (to analyze actual produced code).
Index ¶
- Variables
- func FindRoots(srcs []string, srcRootRegex string) ([]string, error)
- func SplitPackages(srcs []string, srcRootPrefix string) map[string][]string
- func WriteFindingsTo(w io.Writer, findings FindingSet, asJSON bool) error
- type Finding
- type FindingSet
- func Bundle(sources map[string][]string) (FindingSet, facts.Serializer, error)
- func ExtractFindingsFrom(r io.Reader, asJSON bool) (findings FindingSet, err error)
- func ExtractFindingsFromFile(filename string, asJSON bool) (FindingSet, error)
- func Package(path string, srcs []string) (FindingSet, facts.Serializer, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSkip indicates the package should be skipped. ErrSkip = errors.New("skipped") )
Functions ¶
func SplitPackages ¶
SplitPackages splits a typical package structure into packages.
func WriteFindingsTo ¶
func WriteFindingsTo(w io.Writer, findings FindingSet, asJSON bool) error
WriteFindingsTo serializes findings.
Types ¶
type Finding ¶
type Finding struct { Category string Position token.Position Message string GOARCH string GOOS string }
Finding is a single finding.
type FindingSet ¶
type FindingSet []Finding
FindingSet is a collection of findings.
func Bundle ¶
func Bundle(sources map[string][]string) (FindingSet, facts.Serializer, error)
Bundle checks a bundle of files (typically the standard library).
func ExtractFindingsFrom ¶
func ExtractFindingsFrom(r io.Reader, asJSON bool) (findings FindingSet, err error)
ExtractFindingsFrom loads findings from an io.Reader.
func ExtractFindingsFromFile ¶
func ExtractFindingsFromFile(filename string, asJSON bool) (FindingSet, error)
ExtractFindingsFromFile loads findings from a file.
func Package ¶
func Package(path string, srcs []string) (FindingSet, facts.Serializer, error)
Package runs all analyzer on a single package.
Click to show internal directories.
Click to hide internal directories.