Skip to content

Commit 701bd5f

Browse files
committed
internal/scan: remove informational header for package and module mode
It might be confusing and is really not adding any value to the output. Change-Id: Icb65714f5dd111aa875bd88c4e5925a2cab74a19 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/551378 Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com> Reviewed-by: Maceo Thompson <maceothompson@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
1 parent ae31108 commit 701bd5f

File tree

6 files changed

+3
-11
lines changed

6 files changed

+3
-11
lines changed

cmd/govulncheck/testdata/testfiles/source-module/source_module_text.ct

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
$ govulncheck -scan module -C ${moddir}/multientry
55
Scanning your code across 2 dependent modules for known vulnerabilities...
66

7-
=== Informational ===
8-
97
There are 2 vulnerabilities in modules that you require. Use
108
-scan=symbol with govulncheck for more fine grained vulnerability
119
detection.

cmd/govulncheck/testdata/testfiles/source-package/source_package_text.ct

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
$ govulncheck -scan package -C ${moddir}/multientry .
44
Scanning your code and P packages across M dependent modules for known vulnerabilities...
55

6-
=== Informational ===
7-
86
Found 1 vulnerability in packages that you import. There is also 1
97
vulnerability in modules that you require. Use -scan=symbol with
108
govulncheck for more fine grained vulnerability detection.

internal/scan/testdata/module-vuln.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
=== Informational ===
2-
31
There is 1 vulnerability in modules that you require. Use -scan=symbol
42
with govulncheck for more fine grained vulnerability detection.
53
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

internal/scan/testdata/multi-stack-modlevel.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
=== Informational ===
2-
31
There are 2 vulnerabilities in modules that you require. Use
42
-scan=symbol with govulncheck for more fine grained vulnerability
53
detection.

internal/scan/testdata/package-vuln.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
=== Informational ===
2-
31
Found 1 vulnerability in packages that you import. Use -scan=symbol
42
with govulncheck for more fine grained vulnerability detection.
53
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

internal/scan/text.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
154154
if onlyImported+onlyRequired == 0 {
155155
return
156156
}
157-
h.style(sectionStyle, "=== Informational ===\n\n")
157+
if h.scanLevel.WantSymbols() {
158+
h.style(sectionStyle, "=== Informational ===\n\n")
159+
}
158160
var informational strings.Builder
159161
if onlyImported > 0 {
160162
informational.WriteString("Found " + fmt.Sprint(onlyImported))

0 commit comments

Comments
 (0)