Skip to content

Commit

Permalink
internal/scan: fix double line spacing
Browse files Browse the repository at this point in the history
Change-Id: I67d096196a4e54a12b4213c8011406a9ff65759e
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/508921
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Julie Qiu <[email protected]>
Reviewed-by: Julie Qiu <[email protected]>
Run-TryBot: Ian Cottrell <[email protected]>
Auto-Submit: Ian Cottrell <[email protected]>
  • Loading branch information
ianthehat authored and julieqiu committed Jul 13, 2023
1 parent 05958cb commit f69de67
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion cmd/govulncheck/testdata/source_informational_text.ct
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Using go1.18 and [email protected] with vulnerabilit

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


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
1 change: 0 additions & 1 deletion internal/scan/testdata/no-vulns.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Using govulncheck with vulnerability data from .


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
1 change: 0 additions & 1 deletion internal/scan/testdata/platform-all.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Using govulncheck with vulnerability data from .


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
1 change: 0 additions & 1 deletion internal/scan/testdata/platform-one-arch-only.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Using govulncheck with vulnerability data from .


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
1 change: 0 additions & 1 deletion internal/scan/testdata/platform-one-import.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Using govulncheck with vulnerability data from .


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
1 change: 0 additions & 1 deletion internal/scan/testdata/platform-two-imports.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Using govulncheck with vulnerability data from .


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
1 change: 0 additions & 1 deletion internal/scan/testdata/platform-two-os-only.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Using govulncheck with vulnerability data from .


=== Informational ===

Found 1 vulnerability in packages that you import, but there are no call
Expand Down
9 changes: 1 addition & 8 deletions internal/scan/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
called := 0
for _, findings := range byVuln {
if isCalled(findings) {
if called > 0 {
h.print("\n")
}
h.vulnerability(called, findings)
called++
}
Expand All @@ -141,7 +138,6 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
if unCalled == 0 {
return
}
h.print("\n")
h.style(sectionStyle, "=== Informational ===\n")
h.print("\nFound ", unCalled)
h.print(choose(unCalled == 1, ` vulnerability`, ` vulnerabilities`))
Expand All @@ -151,9 +147,6 @@ func (h *TextHandler) byVulnerability(findings []*findingSummary) {
index := 0
for _, findings := range byVuln {
if !isCalled(findings) {
if index > 0 {
h.print("\n")
}
h.vulnerability(index, findings)
index++
}
Expand Down Expand Up @@ -226,6 +219,7 @@ func (h *TextHandler) vulnerability(index int, findings []*findingSummary) {
}
h.traces(module)
}
h.print("\n")
}

func (h *TextHandler) traces(traces []*findingSummary) {
Expand Down Expand Up @@ -258,7 +252,6 @@ func (h *TextHandler) traces(traces []*findingSummary) {

func (h *TextHandler) summary(findings []*findingSummary) {
counters := counters(findings)
h.print("\n")
if counters.VulnerabilitiesCalled == 0 {
h.print("No vulnerabilities found.\n")
return
Expand Down

0 comments on commit f69de67

Please sign in to comment.