Skip to content

Commit a5e767d

Browse files
author
Maceo Thompson
committed
internal/scan: add scan level to textHandler
This change adds scan level to the text handler, which will allow us to change messages depending on the amount of information govulncheck has available to it. For example, it will allow govulncheck to not mention callstacks if it never ran callstack analysis. Change-Id: I9dccd5b0445dddfd8c071bf266ab9eecb0bd0d5e Reviewed-on: https://go-review.googlesource.com/c/vuln/+/545636 Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 75c1acc commit a5e767d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

internal/scan/text.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ func NewTextHandler(w io.Writer) *TextHandler {
3333
}
3434

3535
type TextHandler struct {
36-
w io.Writer
37-
osvs []*osv.Entry
38-
findings []*findingSummary
36+
w io.Writer
37+
osvs []*osv.Entry
38+
findings []*findingSummary
39+
scanLevel govulncheck.ScanLevel
3940

4041
err error
4142

@@ -86,6 +87,9 @@ func (h *TextHandler) Flush() error {
8687

8788
// Config writes version information only if --version was set.
8889
func (h *TextHandler) Config(config *govulncheck.Config) error {
90+
if config.ScanLevel != "" {
91+
h.scanLevel = config.ScanLevel
92+
}
8993
if !h.showVersion {
9094
return nil
9195
}

0 commit comments

Comments
 (0)