From ae31108ea7897c9dc53ddef2f3b22f6223dd9372 Mon Sep 17 00:00:00 2001 From: Zvonimir Pavlinovic Date: Tue, 19 Dec 2023 19:15:09 +0000 Subject: [PATCH] internal/scan: remove redundant newline for package and module mode Change-Id: If35e3951c20ad3c98f8a940172933acce665e7bd Reviewed-on: https://go-review.googlesource.com/c/vuln/+/551377 LUCI-TryBot-Result: Go LUCI Run-TryBot: Zvonimir Pavlinovic TryBot-Result: Gopher Robot Reviewed-by: Maceo Thompson --- .../testdata/testfiles/source-module/source_module_text.ct | 1 - .../testfiles/source-package/source_package_text.ct | 1 - internal/scan/testdata/module-vuln.txt | 1 - internal/scan/testdata/multi-stack-modlevel.txt | 1 - internal/scan/testdata/package-vuln.txt | 1 - internal/scan/text.go | 6 +++--- 6 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cmd/govulncheck/testdata/testfiles/source-module/source_module_text.ct b/cmd/govulncheck/testdata/testfiles/source-module/source_module_text.ct index dff6e1f..d03964a 100644 --- a/cmd/govulncheck/testdata/testfiles/source-module/source_module_text.ct +++ b/cmd/govulncheck/testdata/testfiles/source-module/source_module_text.ct @@ -30,5 +30,4 @@ Vulnerability #2: GO-2021-0113 Found in: golang.org/x/text@v0.3.5 Fixed in: golang.org/x/text@v0.3.7 - Share feedback at https://go.dev/s/govulncheck-feedback. diff --git a/cmd/govulncheck/testdata/testfiles/source-package/source_package_text.ct b/cmd/govulncheck/testdata/testfiles/source-package/source_package_text.ct index 7d382ca..6d6ceda 100644 --- a/cmd/govulncheck/testdata/testfiles/source-package/source_package_text.ct +++ b/cmd/govulncheck/testdata/testfiles/source-package/source_package_text.ct @@ -29,5 +29,4 @@ Vulnerability #2: GO-2021-0113 Found in: golang.org/x/text@v0.3.5 Fixed in: golang.org/x/text@v0.3.7 - Share feedback at https://go.dev/s/govulncheck-feedback. diff --git a/internal/scan/testdata/module-vuln.txt b/internal/scan/testdata/module-vuln.txt index 89c8fe9..906bfd9 100644 --- a/internal/scan/testdata/module-vuln.txt +++ b/internal/scan/testdata/module-vuln.txt @@ -12,5 +12,4 @@ Vulnerability #1: GO-0000-0001 Fixed in: golang.org/vmod@v0.1.3 Platforms: amd - Share feedback at https://go.dev/s/govulncheck-feedback. diff --git a/internal/scan/testdata/multi-stack-modlevel.txt b/internal/scan/testdata/multi-stack-modlevel.txt index a9f9c6e..5bc92b6 100644 --- a/internal/scan/testdata/multi-stack-modlevel.txt +++ b/internal/scan/testdata/multi-stack-modlevel.txt @@ -20,5 +20,4 @@ Vulnerability #2: GO-0000-0001 Fixed in: golang.org/vmod@v0.1.3 Platforms: amd - Share feedback at https://go.dev/s/govulncheck-feedback. diff --git a/internal/scan/testdata/package-vuln.txt b/internal/scan/testdata/package-vuln.txt index 9370565..9ab46c0 100644 --- a/internal/scan/testdata/package-vuln.txt +++ b/internal/scan/testdata/package-vuln.txt @@ -12,5 +12,4 @@ Vulnerability #1: GO-0000-0001 Fixed in: golang.org/vmod@v0.1.3 Platforms: amd - Share feedback at https://go.dev/s/govulncheck-feedback. diff --git a/internal/scan/text.go b/internal/scan/text.go index d88471f..80d3425 100644 --- a/internal/scan/text.go +++ b/internal/scan/text.go @@ -75,7 +75,7 @@ func (h *TextHandler) Flush() error { fixupFindings(h.osvs, h.findings) h.byVulnerability(h.findings) h.summary(h.findings) - h.print("\nShare feedback at https://go.dev/s/govulncheck-feedback.\n") + h.print("Share feedback at https://go.dev/s/govulncheck-feedback.\n") if h.err != nil { return h.err } @@ -298,7 +298,7 @@ func (h *TextHandler) traces(traces []*findingSummary) { func (h *TextHandler) summary(findings []*findingSummary) { counters := counters(findings) if counters.VulnerabilitiesCalled == 0 { - h.print(choose(h.scanLevel.WantSymbols(), "No vulnerabilities found.\n", "")) + h.print(choose(h.scanLevel.WantSymbols(), "No vulnerabilities found.\n\n", "")) return } h.print(`Your code is affected by `) @@ -316,7 +316,7 @@ func (h *TextHandler) summary(findings []*findingSummary) { } h.print(` the Go standard library`) } - h.print(".\n") + h.print(".\n\n") } func (h *TextHandler) style(style style, values ...any) {