In src/cmd/go/testdata/script/mod_load_badzip.txt, remove commands except the go build command, so that go build runs with an empty module.
! go build rsc.io/badzip
What did you expect to see?
The zip file for this module contains a superfluous .info file. We should see an error about that.
What did you see instead?
Instead, we see a message cannot find module providing package.
When we want to load a package that isn't provided by any module in the build list, we attempt to retrieve modules that could provide the package. In this case, we'll look for rsc.io and rsc.io/badzip. Frequently, these modules don't exist (we get a 404 or 410 from the proxy), so if there's an error on every path we try, we report cannot find module providing package.
Many other errors are possible though. We should distinguish "not found" errors from "found but couldn't access" errors.
When we fetch code from a VCS, we have a special codehost.VCSError type which covers "found but couldn't access" errors. Instead, we should define a special "not found" error type in cmd/go/internal/modfetch (used with both proxy and VCS), and we should treat all other errors as "found but couldn't access".
The text was updated successfully, but these errors were encountered: