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>
This commit is contained in:
Zvonimir Pavlinovic 2023-12-19 19:22:07 +00:00
Родитель ae31108ea7
Коммит 701bd5fa06
6 изменённых файлов: 3 добавлений и 11 удалений

Просмотреть файл

@ -4,8 +4,6 @@
$ govulncheck -scan module -C ${moddir}/multientry
Scanning your code across 2 dependent modules for known vulnerabilities...
=== Informational ===
There are 2 vulnerabilities in modules that you require. Use
-scan=symbol with govulncheck for more fine grained vulnerability
detection.

Просмотреть файл

@ -3,8 +3,6 @@
$ govulncheck -scan package -C ${moddir}/multientry .
Scanning your code and P packages across M dependent modules for known vulnerabilities...
=== Informational ===
Found 1 vulnerability in packages that you import. There is also 1
vulnerability in modules that you require. Use -scan=symbol with
govulncheck for more fine grained vulnerability detection.

2
internal/scan/testdata/module-vuln.txt поставляемый
Просмотреть файл

@ -1,5 +1,3 @@
=== Informational ===
There is 1 vulnerability in modules that you require. Use -scan=symbol
with govulncheck for more fine grained vulnerability detection.
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

Просмотреть файл

@ -1,5 +1,3 @@
=== Informational ===
There are 2 vulnerabilities in modules that you require. Use
-scan=symbol with govulncheck for more fine grained vulnerability
detection.

2
internal/scan/testdata/package-vuln.txt поставляемый
Просмотреть файл

@ -1,5 +1,3 @@
=== Informational ===
Found 1 vulnerability in packages that you import. Use -scan=symbol
with govulncheck for more fine grained vulnerability detection.
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

Просмотреть файл

@ -154,7 +154,9 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
if onlyImported+onlyRequired == 0 {
return
}
h.style(sectionStyle, "=== Informational ===\n\n")
if h.scanLevel.WantSymbols() {
h.style(sectionStyle, "=== Informational ===\n\n")
}
var informational strings.Builder
if onlyImported > 0 {
informational.WriteString("Found " + fmt.Sprint(onlyImported))