When I try to build (or test/run) golang code, I get errors like this:
``` Demo.go:10:8: cannot find package "aaa/bbb" in any of: /usr/lib/go/src/aaa/bbb (from $GOROOT) /home/name/go/src/aaa/bbb (from $GOPATH) ```
The problem is, that "/home/name/go" is the default $GOPATH, and I am using some other path. And, yes, my $GOPATH variable is set correctly:
``` [name@computer ~]$ echo $GOPATH /home/name/some/path/go ```
So, it seems that Geany is not actually reading $GOPATH variable, but is just using the default path.
How is geany started? What does env executed via Geany's run function say?
When I start Geany from terminal, go build works fine, and env shows correct $GOPATH. But when I start it from DE menu (XFCE Whisker), I have that problem I've described (go build gives an error, and env does not show $GOPATH).
Is set my $GOPATH in .bashrc script.
Xfce is not parsing .bashrc on startup, therefor Geany does not know about it. Put your export statement into .profile e.g. -- maybe configuring Geany to execute things inside VTE might work -- but unsure about.
I moved my "export $GOPATH=.." to .xprofile, and now it works fine. Thanks.
(I'm using Linux for almost 2 decades now, and I still have no clue how all these start-up scripts are supposed to work.. And I'm proud of it :D)
Actually, even though the knowledge of such things wont make world a better place, being proud of it is not the right answer IMHO ;D
Closed #2390.
github-comments@lists.geany.org