cmd/go: bad error message for local imports in module mode #47088
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
In module mode, if an
import
statement refers to a relative path it is currently supposed to fail withrelative import not supported
:go/src/cmd/go/internal/modload/import.go
Lines 245 to 247 in 600a2a4
However, we seem to be missing test coverage for that error message, and the actual error that is printed for that case is substantially different:
$ go env
That error message comes from here:
go/src/cmd/go/internal/load/pkg.go
Line 758 in 600a2a4
which implies that the error returned by
importFromModules
is either not produced or not propagated as we expect.Discovered via https://stackoverflow.com/q/68261085.
CC @matloob @jayconrod
The text was updated successfully, but these errors were encountered: