-
Notifications
You must be signed in to change notification settings - Fork 18k
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: linker.exe not looking in GOPATH for some packages #18050
Comments
How did you solve this issue? |
Make sure you are using the full path when importing packages (e.g. github.com/BahNahNah/MyProject/controllers) I cant remember exactly what I was doing to cause this error but it was something to do with the way I was importing my controllers package. |
I reslove the problem by remove all file in $GOPATH/pkg. The cause of this problem is that I upgraded golang |
I'm a programmer 5 years, I never had this huge nightmare with new language as I have with GO.
For some reason the compiler just ignores the
and getting the rrror Why it tries /usr/local/go and not $GOPATH? |
@KromDaniel this issue was closed several years ago. I suggest you open a new issue or ask for help using one of the support forums. Please see https://golang.org/wiki/Questions for good places to ask questions. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?version go1.7.3 windows/amd64
What operating system and processor architecture are you using (
go env
)?amd64
windows 10
What did you do?
Importing some(?) packages seems to confuse link.exe
In my "projectname/controllers/users.go" file, i am trying to import the package "github.com/gorilla/mux".
Doing so results in this error:
but my GOPATH variable is set to D:\Dev\Go\Projects. When I change the mux package to an invalid path, I get this error (as expected)
But it is looking in the correct path now.
What did you expect to see?
linker.exe looking in the correct directory for the package.
What did you see instead?
linker.exe only looking in the GOROOT path.
This does not happen in the main package.
The text was updated successfully, but these errors were encountered: