cmd/go: "go mod download" doesn't fetch necessary modules in workspace mode #51946
Labels
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?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?
git clone https://github.com/sergunya/my_workspace; cd my_workspace/
rm go.work.sum
go clean -modcache
cd cmd/my_app/
go mod download
go list -m -json all
What did you expect to see?
github.com/samber/lo@v1.3.2-0.20220305174447-4edabde35217
necessary to buildmy_app
module is downloaded and has a "Dir" property ingo list
output.What did you see instead?
There's no "Dir" property.
I tried to debug Go source code and found that
checksumOk("")
in src/cmd/go/internal/modload/build.go:275 returns false forgithub.com/samber/lo
. Buildingmy_app
usinggo build
adds the necessary checksum togo.work.sum
and the issue disappears. It doesn't help to rungo mod tidy
orgo work sync
beforego mod download
.The text was updated successfully, but these errors were encountered: