cmd/go: Misleading err msg if vendors/modules.txt doesn't exist #53007
Labels
GoCommand
cmd/go
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
)?The bug was originally discovered with using Go
1.17.5
while we were trying to setup a CI for our Go project.It is also reproducible with the latest release and build, such as:
What did you do?
cd $GOPATH/src/github.com/foo/bar
export GO111MODULE=on
export GOFLAGS="-mod=vendor"
vendor
directory there:rm -rf vendor
or if you have rename itmv vendor backup_vendor
.go fmt ./...
What did you expect to see?
I would expect to get an error:
go: open $GOPATH/src/github.com/foo/bar/vendor/modules.txt: no such file or directory
What did you see instead?
It complains about my modules (actually, for every single one of them) that are not in-sync with my vendors, but this comparison never happens in the first place since there's no
vendor/modules.txt
to compare with.The text was updated successfully, but these errors were encountered: