internal/worker: create synthetic modules in compare mode This makes compare mode consistent with other modes and it will reduce the number of errors generated and logged. Change-Id: I6e57f12fe4453990ff1abf6209687a7d03bb574b Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/524576 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com> Reviewed-by: Maceo Thompson <maceothompson@google.com>
diff --git a/internal/worker/govulncheck_scan.go b/internal/worker/govulncheck_scan.go index f61cf04..b3cb27d 100644 --- a/internal/worker/govulncheck_scan.go +++ b/internal/worker/govulncheck_scan.go
@@ -217,7 +217,7 @@ err = doScan(ctx, baseRow.ModulePath, info.Version, s.insecure, func() (err error) { inputPath := moduleDir(baseRow.ModulePath, info.Version) defer derrors.Cleanup(&err, func() error { return os.RemoveAll(inputPath) }) - const init = false + const init = true if err := prepareModule(ctx, baseRow.ModulePath, info.Version, inputPath, s.proxyClient, s.insecure, init); err != nil { log.Errorf(ctx, err, "error trying to prepare module %s", baseRow.ModulePath) return nil