-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
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:
go version devel go1.19-8542bd8938 Thu May 19 19:32:35 2022 +0000 darwin/amd64
What did you do?
- Go to any of your Go projects:
cd $GOPATH/src/github.com/foo/bar - Make sure you have modules enabled:
export GO111MODULE=on - Make sure you have vendor flag enabled:
export GOFLAGS="-mod=vendor" - Make sure there is no
vendordirectory there:rm -rf vendoror if you have rename itmv vendor backup_vendor. - Run
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 directoryWhat did you see instead?
github.com/emicklei/go-restful/v3@v3.7.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
...
...
...
(skip the rest of them for brevity)
...
To ignore the vendor directory, use -mod=readonly or -mod=mod.
To sync the vendor directory, run:
go mod vendor
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.
Metadata
Metadata
Assignees
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.