-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: "unrecognized import path" for local packages after updating to go1.13 #34117
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
That error message comes from here: go/src/cmd/go/internal/get/vcs.go Line 774 in aae0b5b
|
Can you provide a concrete source file that reproduces the issue? There were certainly changes around that code path in 1.13 that may be related, but my understanding (from #26645 (comment) and other previous discussions) is that relative imports have never worked with This may also be related to #12385. |
@nichoriverae just to confirm, is it correct that are you not using modules? One change in Go 1.13 is |
go vet seems to be looking in GOPATH and GOROOT:
|
$ and a simple
|
@bcmills this repo repoduces the error. Granted, it's not using the import that is failing, but the |
@nichoriverae Thank you for putting that repo together. For that repo, what is the exact command sequence that fails, and what is the error you currently get?
Doing |
I'm under the impression these issues are happening because of GOPROXY and my corporate network settings. I changed the environment variable to "direct" and that solved most of my issues. @thepudds I tried the repo on another machine that had a fresh go1.13 install and it didn't give me any problems either, which makes me assume that it is indeed the corporate settings. |
I am testing the |
@bubuzzz, that issue seems unrelated. If you're still seeing a problem, please open a new issue. |
@nichoriverae, I'm having a bit of trouble following the discussion here, but please let us know if there is anything we still need to resolve. |
Hi, my project is organized in GOPATH. I upgrade go from go1.12 to go1.14.
when I run It looks like the same problem. Does the behavior change from Go1.13 when GO111MODULE=off? |
@hitzhangjie Make sure there aren't source files directly in a Also, make sure any imports outside the standard library start with a hostname, for example, |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?$ go env
go env
OutputWhat did you do?
I attempted to go run an application as before, but ran into an unrecognized import path error. Previously with 1.12 I did not have an issue. These are imports from sub packages within a main package.
running
go get -u ./...
returns:
package _/*/src: unrecognized import path "_/*/src" (import path does not begin with hostname)
What did you expect to see?
That local packages don't need a hostname, and they don't fail to "get".
What did you see instead?
"import path does not begin with hostname"
The text was updated successfully, but these errors were encountered: