Skip to content
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: list: incomplete error "no Go files in" #26297

Closed
alandonovan opened this issue Jul 9, 2018 · 1 comment
Closed

cmd/go: list: incomplete error "no Go files in" #26297

alandonovan opened this issue Jul 9, 2018 · 1 comment

Comments

@alandonovan
Copy link
Contributor

$ cat a.go
package p

import "missing"

$ command go version
go version devel +4da84adc0c Mon Jul 9 19:35:21 2018 +0000 linux/amd64
$ command go list -export -e  a.go
go build missing: no Go files in 
command-line-arguments

I expect the fix is something like this:

--- a/src/cmd/go/internal/load/pkg.go
+++ b/src/cmd/go/internal/load/pkg.go
@@ -185,6 +185,9 @@ func (e *NoGoError) Error() string {
                // to appear at the end of error message.
                return "no non-test Go files in " + e.Package.Dir
        }
+       if e.Package.Dir == "" {
+               return "no directory for package " + e.Package.ImportPath
+       }
        return "no Go files in " + e.Package.Dir
 }
@alandonovan
Copy link
Contributor Author

alandonovan commented Jul 9, 2018

Oops, UI glitch created duplicate of #26296.

@golang golang locked and limited conversation to collaborators Jul 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants