Documentation
¶
Overview ¶
Package scan provides functionality for running govulncheck.
See cmd/govulncheck/main.go as a usage example.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// Stdin specifies the standard input. If provided, it is expected to be
// the output of govulncheck -json.
Stdin io.Reader
// Stdout specifies the standard output. If nil, Run connects os.Stdout.
Stdout io.Writer
// Stderr specifies the standard error. If nil, Run connects os.Stderr.
Stderr io.Writer
// Env is the environment to use.
// If Env is nil, the current environment is used.
// As in os/exec's Cmd, only the last value in the slice for
// each environment key is used. To specify the setting of only
// a few variables, append to the current environment, as in:
//
// opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386")
//
Env []string
// contains filtered or unexported fields
}
Cmd represents an external govulncheck command being prepared or run, similar to exec.Cmd.
func (*Cmd) Start ¶
Start starts the specified command but does not wait for it to complete.
After a successful call to Start the Wait method must be called in order to release associated system resources.
func (*Cmd) Wait ¶
Wait waits for the command to exit. The command must have been started by Start.
If the command fails to run or does not complete successfully, the returned error wraps an error implementing:
interface {
ExitCode() int
}
Callers can use errors.As to retrieve the exit code. Other errors may be returned for other problems (e.g. I/O issues).
Wait releases any resources associated with the Cmd.