Skip to content

Commit

Permalink
internal/scan: use summary if available
Browse files Browse the repository at this point in the history
Prefer using the osv summary rather than the details if it has one.

Change-Id: Icebfabd0f17c04c84cfafe4ee5ca7c1704a7f3d5
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/502940
Auto-Submit: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
  • Loading branch information
ianthehat authored and gopherbot committed Jun 13, 2023
1 parent 17e4027 commit 7c36ae1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/scan/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ func (h *TextHandler) vulnerability(index int, findings []*findingSummary) {
}
h.print("\n")
h.style(detailsStyle)
h.wrap(" ", findings[0].OSV.Details, 80)
description := findings[0].OSV.Summary
if description == "" {
description = findings[0].OSV.Details
}
h.wrap(" ", description, 80)
h.style(defaultStyle)
h.print("\n")
h.style(keyStyle, " More info:")
Expand Down

0 comments on commit 7c36ae1

Please sign in to comment.