Skip to content

Commit

Permalink
internal/vulncheck: improve progress message for binaries
Browse files Browse the repository at this point in the history
Change-Id: Ib5b4b335e44d3ca3e72f4772b7e03fca615e7ae7
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/580158
Auto-Submit: Zvonimir Pavlinovic <[email protected]>
Reviewed-by: Maceo Thompson <[email protected]>
Run-TryBot: Zvonimir Pavlinovic <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
zpavlinovic authored and gopherbot committed Apr 22, 2024
1 parent 086b27b commit 230480c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ govulncheck -format json -mode binary ${common_vuln_binary}
}
{
"progress": {
"message": "Checking the code against the vulnerabilities..."
"message": "Checking the binary against the vulnerabilities..."
}
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ govulncheck -format json -mode binary ${common_vendored_binary}
}
{
"progress": {
"message": "Checking the code against the vulnerabilities..."
"message": "Checking the binary against the vulnerabilities..."
}
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ govulncheck -format json -mode binary -scan module ${common_vuln_binary}
}
{
"progress": {
"message": "Checking the code against the vulnerabilities..."
"message": "Checking the binary against the vulnerabilities..."
}
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ govulncheck -format json -mode binary -scan package ${common_vuln_binary}
}
{
"progress": {
"message": "Checking the code against the vulnerabilities..."
"message": "Checking the binary against the vulnerabilities..."
}
}
{
Expand Down
2 changes: 1 addition & 1 deletion internal/vulncheck/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func binary(ctx context.Context, handler govulncheck.Handler, bin *Bin, cfg *gov
return nil, err
}

if err := handler.Progress(&govulncheck.Progress{Message: checkingVulnsMessage}); err != nil {
if err := handler.Progress(&govulncheck.Progress{Message: checkingBinVulnsMessage}); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/vulncheck/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func source(ctx context.Context, handler govulncheck.Handler, cfg *govulncheck.C
return nil, err
}

if err := handler.Progress(&govulncheck.Progress{Message: checkingVulnsMessage}); err != nil {
if err := handler.Progress(&govulncheck.Progress{Message: checkingSrcVulnsMessage}); err != nil {
return nil, err
}

Expand Down
5 changes: 3 additions & 2 deletions internal/vulncheck/vulncheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import (
)

const (
fetchingVulnsMessage = "Fetching vulnerabilities from the database..."
checkingVulnsMessage = "Checking the code against the vulnerabilities..."
fetchingVulnsMessage = "Fetching vulnerabilities from the database..."
checkingSrcVulnsMessage = "Checking the code against the vulnerabilities..."
checkingBinVulnsMessage = "Checking the binary against the vulnerabilities..."
)

// Result contains information on detected vulnerabilities.
Expand Down

0 comments on commit 230480c

Please sign in to comment.