Each govulncheck scan resolves the full dependency tree of the module.
The scanner kept these modules in the shared Go module cache. On the
deployed host that cache grew to 13G, which is nine times the size of
the packages the proxy serves.
The scan now sets GOMODCACHE to a directory inside its temp dir. The
directory is deleted when the scan ends. GOFLAGS adds -modcacherw,
because Go makes the module cache read-only and RemoveAll cannot
delete it otherwise. A failed delete is logged.
A module was charged with advisories against its dependencies at the minimum versions in its go.mod. A consuming build resolves its own versions, so these findings do not describe the module. On production golang.org/x/net v0.56.0 carried x/crypto and x/text advisories this way. Stdlib findings describe the scanner toolchain and are also dropped.
govulncheck prints indented JSON objects. The line parser read none of
them, so every module read clean.
govulncheck also never reports advisories against the main module of the
tree it scans. A scan of the x/text 0.3.5 source found nothing. The
module is now a dependency of a wrapper module that imports its
packages, and the scan runs at module level.