Skip to content

Commit f69de67

Browse files
ianthehatjulieqiu
authored andcommitted
internal/scan: fix double line spacing
Change-Id: I67d096196a4e54a12b4213c8011406a9ff65759e Reviewed-on: https://go-review.googlesource.com/c/vuln/+/508921 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Julie Qiu <julie@golang.org> Reviewed-by: Julie Qiu <julieqiu@google.com> Run-TryBot: Ian Cottrell <iancottrell@google.com> Auto-Submit: Ian Cottrell <iancottrell@google.com>
1 parent 05958cb commit f69de67

8 files changed

+1
-15
lines changed

cmd/govulncheck/testdata/source_informational_text.ct

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Using go1.18 and govulncheck@v0.0.0-00000000000-20000101010101 with vulnerabilit
55

66
Scanning your code and P packages across M dependent modules for known vulnerabilities...
77

8-
98
=== Informational ===
109

1110
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/testdata/no-vulns.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Using govulncheck with vulnerability data from .
22

3-
43
=== Informational ===
54

65
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/testdata/platform-all.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Using govulncheck with vulnerability data from .
22

3-
43
=== Informational ===
54

65
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/testdata/platform-one-arch-only.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Using govulncheck with vulnerability data from .
22

3-
43
=== Informational ===
54

65
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/testdata/platform-one-import.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Using govulncheck with vulnerability data from .
22

3-
43
=== Informational ===
54

65
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/testdata/platform-two-imports.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Using govulncheck with vulnerability data from .
22

3-
43
=== Informational ===
54

65
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/testdata/platform-two-os-only.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Using govulncheck with vulnerability data from .
22

3-
43
=== Informational ===
54

65
Found 1 vulnerability in packages that you import, but there are no call

internal/scan/text.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
130130
called := 0
131131
for _, findings := range byVuln {
132132
if isCalled(findings) {
133-
if called > 0 {
134-
h.print("\n")
135-
}
136133
h.vulnerability(called, findings)
137134
called++
138135
}
@@ -141,7 +138,6 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
141138
if unCalled == 0 {
142139
return
143140
}
144-
h.print("\n")
145141
h.style(sectionStyle, "=== Informational ===\n")
146142
h.print("\nFound ", unCalled)
147143
h.print(choose(unCalled == 1, ` vulnerability`, ` vulnerabilities`))
@@ -151,9 +147,6 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
151147
index := 0
152148
for _, findings := range byVuln {
153149
if !isCalled(findings) {
154-
if index > 0 {
155-
h.print("\n")
156-
}
157150
h.vulnerability(index, findings)
158151
index++
159152
}
@@ -226,6 +219,7 @@ func (h *TextHandler) vulnerability(index int, findings []*findingSummary) {
226219
}
227220
h.traces(module)
228221
}
222+
h.print("\n")
229223
}
230224

231225
func (h *TextHandler) traces(traces []*findingSummary) {
@@ -258,7 +252,6 @@ func (h *TextHandler) traces(traces []*findingSummary) {
258252

259253
func (h *TextHandler) summary(findings []*findingSummary) {
260254
counters := counters(findings)
261-
h.print("\n")
262255
if counters.VulnerabilitiesCalled == 0 {
263256
h.print("No vulnerabilities found.\n")
264257
return

0 commit comments

Comments
 (0)