Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link GOPATH to LiteIDE?

Tags:

go

liteide

I've installed LiteIde and exported GOROOT and GOPATH in my .bashrc. When I use LiteIDE, the auto-completion works just fine, but it can't build/run my code. When I look at 'Manage GOPATH', the System GOPATH box is empty, and I can't type into it either.

Looking up online, the solution seems to be - 'link' the GOPATH and LiteIDE. How do I 'link' the two?

like image 218
tldr Avatar asked Aug 10 '13 20:08

tldr


2 Answers

Select the correct environment for you system from the drop-down:

enter image description here

For example, if you're on a Mac and used the package installer it would be "darwin64-local" on a 64 bit Mac.

Then click on the "Go" folder icon on the left of the drop-down.

enter image description here

Click "Add Directory..." and add a folder path that contains src, pkg, and bin folders. Essentially what you set GOPATH to.

Make sure you do not set GOROOT in .bashrc at all. You don't need to set GOROOT, really.

like image 154
Luke Avatar answered Oct 17 '22 03:10

Luke


Follow the answer above, but then regarding the updated problems with the build path being incorrect:

If you "build" in Liteide then the executable gets put in the same file as your .go file.

But by clicking "install" in Liteide then the executable gets placed in the go workspace root bin folder as it should be.

You can still "run" the code from within Liteide if there is not the executable in the same folder as your .go file.

like image 41
Kyohei Kaneko Avatar answered Oct 17 '22 02:10

Kyohei Kaneko