x/tools/imports: package in v2 module listed in go.mod is resolved to non-listed v1 #58382
Labels
gopls/imports
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
)?Does this issue reproduce with the latest release?
yes
Issue is reproducible with the latest commit from the repository:
What did you do?
main.go
without incomplete imports.xurls
symbol is not linked to any declared imports.go.mod
to list dependencies. One module has major version 2:mvdan.cc/xurls/v2@v2.4.0
goimports
to fix importsWhat did you expect to see?
Imports fixed in
main.go
. In particular an import ofmvdan.cc/xurls/v2
.What did you see instead?
I get an import of
mvdan.cc/xurls
(which is v1 and a different API) instead ofmvdan.cc/xurls/v2
.As a result the code modified by the goimports doesn't compile.
The text was updated successfully, but these errors were encountered: