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 message "no Go files in" #26296

Open
alandonovan opened this issue Jul 9, 2018 · 4 comments
Open

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

alandonovan opened this issue Jul 9, 2018 · 4 comments
Labels
NeedsFix
Milestone

Comments

@alandonovan
Copy link
Contributor

@alandonovan alandonovan commented Jul 9, 2018

$ 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 alandonovan assigned alandonovan and rsc and unassigned alandonovan Jul 9, 2018
@ianlancetaylor ianlancetaylor added the NeedsFix label Jul 9, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Jul 9, 2018
@odeke-em
Copy link
Member

@odeke-em odeke-em commented Jul 31, 2018

How's it going @alandonovan? Might you have some bandwidth to get this in before the end of the week? If not, no worries :)

@mvdan
Copy link
Member

@mvdan mvdan commented Aug 1, 2018

I believe Alan is still on holiday :) Unless you meant to ping Russ? Either way, it will get some attention as it's milestoned for 1.11.

@rsc
Copy link
Contributor

@rsc rsc commented Aug 10, 2018

The root cause here is #26909. Once that's fixed, the bogus NoGoError should not be generated at all anymore.

@rsc
Copy link
Contributor

@rsc rsc commented Aug 17, 2018

Leaving for Go 1.12.

@rsc rsc removed this from the Go1.11 milestone Aug 17, 2018
@rsc rsc added this to the Go1.12 milestone Aug 17, 2018
@bcmills bcmills removed this from the Go1.12 milestone Jan 18, 2019
@bcmills bcmills added this to the Go1.13 milestone Jan 18, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

7 participants