Skip to content

Commit

Permalink
gopls/internal/vulncheck: adjust logging
Browse files Browse the repository at this point in the history
Report # of findings

Change-Id: Ib10d18a23280a8644b9c08a8d51d6e288ae761db
Reviewed-on: https://go-review.googlesource.com/c/tools/+/415496
Reviewed-by: Suzy Mueller <suzmue@golang.org>
  • Loading branch information
hyangah committed Jul 25, 2022
1 parent 04bd087 commit 005c07a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gopls/internal/vulncheck/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,19 @@ func (c *cmd) Run(ctx context.Context, cfg *packages.Config, patterns ...string)
log.Printf("package load failed: %v", err)
return nil, err
}
log.Printf("loaded %d packages\n", len(loadedPkgs))

log.Printf("analyzing %d packages...\n", len(loadedPkgs))

r, err := vulncheck.Source(ctx, loadedPkgs, &vulncheck.Config{Client: c.Client, SourceGoVersion: goVersion()})
if err != nil {
return nil, err
}

log.Printf("selecting affecting vulnerabilities from %d findings...\n", len(r.Vulns))
unaffectedMods := filterUnaffected(r.Vulns)
r.Vulns = filterCalled(r)

log.Printf("found %d vulnerabilities.\n", len(r.Vulns))
callInfo := gvc.GetCallInfo(r, loadedPkgs)
return toVulns(callInfo, unaffectedMods)
// TODO: add import graphs.
Expand Down

0 comments on commit 005c07a

Please sign in to comment.