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: generate panics when go files provided as arguments and modules are on #29097
Comments
/cc @bcmills Tentatively marking as release blocker. |
I looked into this today. I think this started with CL 148517, which added support for "go get" outside of a module. Several commands including fix, generate, list, run, build either panic or print a stack (via I have a CL mostly ready that fixes this. However, it's not clear to me that we want to allow all of these commands to run outside of modules. These commands could all do reasonable things (e.g., Will discuss with @bcmills tomorrow. |
Note that this also happens within modules. If you add a |
@jayconrod, in general any command should work as long as it (a) does not exist solely for editing the |
Change https://golang.org/cl/153158 mentions this issue: |
Change https://golang.org/cl/153159 mentions this issue: |
That file is supposed to make unexpected dependencies on the main module easier to diagnose in 'go test cmd/go', but I accidentally left off the build constraint, so it was triggering outside of the test. Updates #29097 Change-Id: I1cde3fe6c1d80add37c98a8c95ce48524ea05024 Reviewed-on: https://go-review.googlesource.com/c/153159 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
What version of Go are you using (
go version
)?(also happens on a non-dirty tree):
Does this issue reproduce with the latest release?
No, 1.11.2 works as expected.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Nothing happens because the file has no generate comment.
What did you see instead?
pkg.Module
is nil, so Go generate panics (cmd/go/internal/generate/generate.go:167)The text was updated successfully, but these errors were encountered: