Documentation
¶
Index ¶
- func GoBuild(t *testing.T, dir, tags string, strip bool, envVarVals ...string) (binaryPath string, cleanup func())
- func NeedsGoEnv(t testing.TB)
- func VerifyImports(t *testing.T, allowed ...string)
- type MockHandler
- func (h *MockHandler) Config(config *govulncheck.Config) error
- func (h *MockHandler) Finding(finding *govulncheck.Finding) error
- func (h *MockHandler) OSV(entry *osv.Entry) error
- func (h *MockHandler) Progress(progress *govulncheck.Progress) error
- func (h *MockHandler) SBOM(sbom *govulncheck.SBOM) error
- func (h *MockHandler) Sort()
- func (h *MockHandler) Write(to govulncheck.Handler) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoBuild ¶
func GoBuild(t *testing.T, dir, tags string, strip bool, envVarVals ...string) (binaryPath string, cleanup func())
GoBuild runs "go build" on dir using the additional environment variables in envVarVals, which should be an alternating list of variables and values. It returns the path to the resulting binary, and a function to call when finished with the binary.
func NeedsGoEnv ¶
NeedsGoEnv skips t if the current system can't get the environment with “go env” in a subprocess.
func VerifyImports ¶
Types ¶
type MockHandler ¶ added in v0.2.0
type MockHandler struct { ConfigMessages []*govulncheck.Config SBOMMessages []*govulncheck.SBOM ProgressMessages []*govulncheck.Progress OSVMessages []*osv.Entry FindingMessages []*govulncheck.Finding }
MockHandler implements govulncheck.Handler but (currently) does nothing.
For use in tests.
func NewMockHandler ¶ added in v0.2.0
func NewMockHandler() *MockHandler
func (*MockHandler) Config ¶ added in v0.2.0
func (h *MockHandler) Config(config *govulncheck.Config) error
func (*MockHandler) Finding ¶ added in v0.2.0
func (h *MockHandler) Finding(finding *govulncheck.Finding) error
func (*MockHandler) Progress ¶ added in v0.2.0
func (h *MockHandler) Progress(progress *govulncheck.Progress) error
func (*MockHandler) SBOM ¶ added in v1.1.4
func (h *MockHandler) SBOM(sbom *govulncheck.SBOM) error
func (*MockHandler) Sort ¶ added in v0.2.0
func (h *MockHandler) Sort()
func (*MockHandler) Write ¶ added in v0.2.0
func (h *MockHandler) Write(to govulncheck.Handler) error
Click to show internal directories.
Click to hide internal directories.