cmd/go: clarify error message when importing a package that could be (but isn't) in the main module #34491
Labels
GoCommand
cmd/go
help wanted
modules
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
What did you do?
I imported a path that was not a valid package (because of a combination of build tags, test files,
documentation
package files, and/or no files present, but was a valid path to a directory on a filesystem (one which contained (an)other package(s)).go build ./...
andgo test ./...
andgo mod tidy
report an error in finding the path to the package within the module.What did you expect to see?
I guess it would have been nice to see (both) 2 things output (as @Helcaraxan and @thepudds have suggested in Gophers slack (#modules):
What did you see instead?
Before the module was pushed to a GitHub repository (everything local)
and after the module was pushed to a repository (
github.com/johnrichardrinehart/a
) instead of (github.com/a
, as in the gist):The text was updated successfully, but these errors were encountered: