Closed leonelquinteros closed 6 years ago
The GOPATH that Goclipse uses might be different from the GOPATH environment variable. It seems that somehow /Users/leo/Dev/go/src/github.com/leonelquinteros/gotext
is being added to it, although that should not be the case.
What's the full output of the Go build console in Eclipse? It should mention which GOPATH it tried to use. For example:
==================== Starting Go build ====================
************ Building Go project: blah ************
with GOPATH: D:\devel\go-workspace
>> Running: D:\devel\tools\go\bin\go.exe install -v -gcflags "-N -l" com.myproj/bruno/...
Actually, there is no output in the console, the error message is displayed in a popup.
But based on your comment, i've been able to solve the issue:
On Preferences -> Go -> Eclipse GOPATH
i had Use same value as the GOPATH environment variable
checked.
So i've unchecked that and manually entered the same value from $GOPATH and now it works. It seems like Eclipse or Goclipse can't read the environment variable from my user or something. Not sure it that's something you want to check or you can reproduce.
I'm using:
Let me know if you want help digging into this, but it's solved by setting the GOPATH manually in the Eclipse configuration.
Sometimes there's issues in Mac OS in where an env var is set but it applies only to the console, but not to apps started through the UI, maybe that's the issue?
If you check Use same value as the GOPATH environment variable
, the value that will appear in the now disabled text box, is the value that Goclipse sees as the GOPATH. So if that value is different from what you entered manually, it's prob the env-var configuration mismatch on your OS.
Otherwise, it might be Goclipse bug.
That seems to be the reason. Then the check is marked, the input field is empty, so it looks like Eclipse isn't reading the environment variable.
Thanks for your support!
Goclipse version:
GoClipse 0.16.1.v201607061938 goclipse_feature.feature.group github.com/GoClipse/
When trying to build a project that resides inside the GOPATH (as any Go developer would have following the official docs at https://golang.org/doc/code.html ) i get the following error.
My GOPATH points to the right directory:
The Goclipse User Guide says:
And this is the way any Go developer would go with, there is no much reason, other than exceptions, to have a different setup, and certainly, having the src/pkg/bin directories inside the code repository doesn't make much sense to me.