x/tools/cmd/goimports: does not find import with package in vendor/, GOFLAGS="-mod=vendor" and empty $GOPATH/pkg directory #32084
Labels
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?goimports from from https://github.com/golang/tools, commit
d1a3278ee74994e9aa609e9e711c616bba677d5d
Does this issue reproduce with the latest release?
Yes, reproducible with go 1.12.5
What operating system and processor architecture are you using (
go env
)?What did you do?
The project has a a
main.go
file that imports the external dependencygithub.com/lib/pq
.The external modules are downloaded into
vendor/
viago mod vendor
."github.com/lib/pq"
import from main.go:$GOPATH/pkg
, run goimports withGOFLAGS=-mod=vendor
:What did you expect to see?
goimports detects the missing
github.com/lib/pq
import and shows it in the diff.What did you see instead?
goimports does not find the missing
github.com/lib/pg
import and prints no diff.The text was updated successfully, but these errors were encountered: