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.
Analysis
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:
What version of Go are you using (
go version
)?go1.12.4 and master (
049c8dbf
)Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
In src/cmd/go/testdata/script/mod_load_badzip.txt, remove commands except the
go build
command, so thatgo 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
.Analysis
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
andrsc.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 reportcannot 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 incmd/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: