-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: no helpful error message for "no Go files" with modules #27122
Comments
Note that this relatively unhelpful error message still occurs with 1.11.4 and 1.12beta1.
Fails with:
One solution (as covered in an FAQ on the modules wiki) is |
#29268 is related. |
I have been writing Go (it was the first language I really learned well) and so |
Perhaps Failing that, the error message could use some work. |
#31270 might be a dup of this. |
I was following a tutorial for something (gRPC) and the tutorial makes use of modules, so I got to learn about them too \o/ However I had an issue where I had made a mistake and the error message from Below is pasted the file tree, the root go.mod, the code that was generating the error, the command being executed and the error message. The error turned out to be that the import path was pointed at a directory with no go source files, but the error reported was "cannot find module providing package"
|
Change https://golang.org/cl/185345 mentions this issue: |
This appears to be fixed at head.
|
This change is a non-minimal fix for #32917, but incidentally fixes several other bugs and makes the error messages much more ergonomic. Updates #32917 Updates #27122 Updates #28459 Updates #29280 Updates #30590 Updates #37214 Updates #36173 Updates #36587 Fixes #36008 Fixes #30992 Change-Id: Iedb26d2e0963697c130df5d0f72e7f83ec2dcf06 Reviewed-on: https://go-review.googlesource.com/c/go/+/185345 Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
Without modules, the go tool informs me that I'm trying to build a package with no Go files:
With modules, I get an obscure error:
The text was updated successfully, but these errors were encountered: