-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: relative imports work when specify .go files directly #51125
Comments
This does appear to be a regression in Go 1.18. I'm in the process of tracking it down, but given the failure mode (a package that compiles when it shouldn't) I don't think it's severe enough to hold up the release. (If nothing else, we can fix it in a backport in 1.18.1.) |
Bisected:
That's a strong clue to run with. I'll work on a fix. |
Change https://go.dev/cl/386176 mentions this issue: |
I am using golang:1.18beta2.
It seems 1.18 allows relative packages (import "./mypkg"), this is with or without go.mod and any setting (or not) of GO111MODULE.
Maybe this is expected, I just can't infer that from release notes. Largely just looking for guidance around using 'replace' versus 'relative'.
Here is my test layout (and it runs and prints hello).
Here was my test script:
Run it without go.mod, then again with go.mod, both work for 1.18beta2.
The text was updated successfully, but these errors were encountered: