-
Notifications
You must be signed in to change notification settings - Fork 572
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
not finding $GOPATH package imports #224
Comments
I have the same problem on os x |
Looking through the source, it seems that the plugin doesn't use the $GOPATH (to be fair, I think earlier Go docs didn't make the distinction between using $GOPATH and $GOROOT quite as clear as they do now). In setting up the plugin you have to |
yes, I use the workaround already (for the $GOPATH), but its bad. |
Just confirmed with the Go guys, we should have a single $GOPATH with all libs and projects under its 'src' directory, and not have different 'src' directories within each project. To make this work right now,
|
This isn't working for me. I am on os x and my GOROOT is ~/go and GOPATH is ~/go/src. So far It cannot find the imports from github.com EDIT: somehow, it works now. I had to restart intelliJ. |
I have the same problem, can't find the GOPATH if it's not under GOROOT directory. |
@pyanfield Yes, the plugin works pretty well, but it doesn't follow go conventions with regards to GOPATH. It wants to find all your libs in either your project directory, or your GOROOT, neither of which fits Go convention. It works if you symlink from your GOROOT to your GOPATH, as discussed above, because those two directories are both stable if you are using Go conventions (one GOPATH covering all your libs and projects). You might have to recreate the symlinks after upgrading Go, but otherwise you should be good. As a side note, earlier in Go there was a tendency to put libs in the GOROOT, which gives some context to this plugin's behavior. I confirmed the current, "correct" convention directly with the Go team a couple months ago, but for some reason I wasn't able to explain it well enough to @mtoader ( see issue #215 ). Nonetheless, for a conventional Go dev environment, Then everything will work fine under your $GOPATH/src/github.com/username/project If you leave the "src" in the Create source directory dialogue, you'll get $GOPATH/src/github.com/username/project/src (oops). |
Why this issue is closed? i still have the same issue with latest InteiJ 13.1.4 and golang plugin 0.9.15.3. |
Same here |
Me too |
the same problem on mac os |
Since we, the developers of the plugin, are developers just like you, the users of the plugin, getting comments on tickets with the content: "me too" helps us identify and fix issues just like it helps you when you receive issues like this in your daily activity. Thank you. |
To provide some more context on the broader issue: The plugin will focus on supporting writing go code using the concept of Workspace (as described here: https://golang.org/doc/code.html#Workspaces). This is the guidance on using relative imports paths: https://golang.org/cmd/go/#hdr-Relative_import_paths. The takeaways are:
We most likely not make any special effort to support relative imports if it proves too costly. Also some of the issues reported here stem from another big problem with the plugin that we are in the course of resolving soonish. My instinct is to close this as it doesn't really provide a lot of value to the development of the plugin right now but i'll let it like this for a while until we have updated information on this. |
I have resolved this problem via mac's ln demand. |
I cannot get the plugin to find the packages imported into my projects.
Right now I'm trying the simplest possible structure - exactly per the Go docs:
mine
$HOME/go/src/mycompany/myproject/hello.go
imported
$HOME/go/src/thirdparty/theirproject/say.go
import "theirproject/say"
go get
Everything works fine (predictably) from the command line. But still the plugin is not able to find the imported package.
I tried fiddling with the project structure (adding the gopath src directory as a library, etc), but to no avail.
Could anybody shed some light on how to get the plugin to pick up the installed packages (obviously located in $GOPATH/src)?
The text was updated successfully, but these errors were encountered: