cmd/go: improve error message for missing dependencies when building files from another module #45014
Labels
BadErrorMessage
Issues related compiler error messages that should be better.
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Let's say I have a module,
foo
, with amain.go
file with a dependency onfilippo.io/edwards25519
. If I run or buildmain.go
from insidefoo
, everything goes well.If I run it or build it from outside the module, I get
If I run it or build it from inside a different module, I get
In both cases, the error message could have noticed that
main.go
is inside a (different) module, and added something like(
go run
andgo build
with.go
files are a constant source of confusion, got way less useful with modules because one can't just run arbitrary files as scripts from anywhere, and should IMHO be deprecated, but while we support them we should try to make them less painful.)The text was updated successfully, but these errors were encountered: