scan

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: BSD-3-Clause Imports: 5 Imported by: 4

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 Command

func Command(ctx context.Context, arg ...string) *Cmd

Command returns the Cmd struct to execute govulncheck with the given arguments.

func (*Cmd) Start

func (c *Cmd) Start() error

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

func (c *Cmd) Wait() error

Wait waits for the command to exit. The command must have been started by Start.

Wait releases any resources associated with the Cmd.

Jump to

Keyboard shortcuts

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