-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: add tests describing 'go run' behavior with GO111MODULE=on #26709
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
Comments
Problem remains in:
|
I think this is intended behavior. If It seems awkward to have to look at the set of imports to determine whether we need a module definition: I'd rather we require it unconditionally. |
Actually, I don't know why I thought this should work. You're quite right; if I can create an arbitrary I'd be happy for this to be closed unless you think there's actually something to decide? |
Actually @bcmills, I think there is some sort of issue here, even when I do create a
succeeds and gives:
Equally:
also gives:
But then if I:
I get:
So it seems, with Or do you think this is a duplicate of #26722? |
I'm not sure, but we can certainly add some tests to |
Confirmed that the repro in #26709 (comment) is solved by https://go-review.googlesource.com/c/go/+/127796 (the fix for #26722) Will leave this open for, as @bcmills suggests, adding such a test case. |
Please don't make |
I would expect It's less clear to me whether |
@bcmills, is this fixed by the "in-memory empty go.mod" behavior we added? |
Yes, |
Please answer these questions before submitting your issue. Thanks!
This might be a duplicate of/covered by the solution to #26639, but I wanted to create a separate issue for
go run
because that could be considered to be a particularly special case amongst the various commands.What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
n/a: testing with tip.
What operating system and processor architecture are you using (
go env
)?Not available directly because of #26639, but:
What did you do?
What did you expect to see?
If my assumption that a
go.mod
shouldn't be required is correct, zero exit code and:What did you see instead?
Non-zero exit code and:
/cc @rsc @bcmills
The text was updated successfully, but these errors were encountered: