vulncheck

package
v0.11.0-pre.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Overview

Package vulncheck provides an analysis command that runs vulnerability analysis using data from golang.org/x/vuln/vulncheck. This package requires go1.18 or newer.

Index

Constants

View Source
const GoVersionForVulnTest = "_GOPLS_TEST_VULNCHECK_GOVERSION"

GoVersionForVulnTest is an internal environment variable used in gopls testing to examine govulncheck behavior with a go version different than what `go version` returns in the system.

Variables

View Source
var Govulncheck func(ctx context.Context, cfg *packages.Config, patterns string) (res command.VulncheckResult, _ error) = nil

Govulncheck runs the in-process govulncheck implementation. With go1.18+, this is swapped with the real implementation.

View Source
var Main func(cfg packages.Config, patterns ...string) error = nil
View Source
var VulnerablePackages func(ctx context.Context, snapshot source.Snapshot, modfile source.FileHandle) (*govulncheck.Result, error) = nil

VulnerablePackages queries the vulndb and reports which vulnerabilities apply to this snapshot. The result contains a set of packages, grouped by vuln ID and by module.

Functions

func GoTagToSemver added in v0.11.0

func GoTagToSemver(tag string) string

This is a modified copy of pkgsite/internal/stdlib:VersionForTag.

Types

type CallStack

type CallStack = command.CallStack

type Cmd

type Cmd struct {
	Client client.Client
}

Cmd is an in-process govulncheck command runner that uses the provided client.Client.

func (*Cmd) Run

func (c *Cmd) Run(ctx context.Context, cfg *packages.Config, patterns ...string) (_ []Vuln, err error)

Run runs the govulncheck after loading packages using the provided packages.Config.

type StackEntry

type StackEntry = command.StackEntry

type Vuln

type Vuln = command.Vuln

Directories

Path Synopsis
Package vulntest provides helpers for vulncheck functionality testing.
Package vulntest provides helpers for vulncheck functionality testing.

Jump to

Keyboard shortcuts

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