9

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?

OneOfOne
  • 95,033
  • 20
  • 184
  • 185
tldr
  • 11,924
  • 15
  • 75
  • 120

2 Answers2

20

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.

Luke
  • 13,678
  • 7
  • 45
  • 79
  • I followed the instructions, also removed GOROOT from bashrc. But I still get the error: Could not parse action 'Build' – tldr Aug 11 '13 at 01:18
  • @tldr OS? Version of LiteIDE? – Luke Aug 12 '13 at 14:54
  • Have you tried [X19](https://code.google.com/p/golangide/downloads/detail?name=liteidex19.macosx.zip)? – Luke Aug 12 '13 at 15:58
  • That helped a bit, but not entirely. Now I get: – tldr Aug 12 '13 at 18:09
  • go build [/Users/jashua/Desktop/go/src] \n Error: process failed to start. – tldr Aug 12 '13 at 18:17
  • @tldr It would seem that you don't have the correct environment selected. If you installed the package, you should use the "-local" version. If you built it yourself you may have to edit it yourself. Click the icon on the right side of the drop-down to edit it. You should see where LiteIDE is looking for the `go` tool. – Luke Aug 12 '13 at 18:24
  • That was it! Thank you so much! But now it tries to build everything inside the src directory. If I want to run a simple helloworld program, I can do "go run helloworld.go" in the terminal, and it runs fine. But if I try to build the file in LiteIde, it tries to build all the files in src. Is there anyway to build and run just the file I'm viewing? – tldr Aug 12 '13 at 18:41
  • @tldr I'm not sure. I prefer GoSublime personally. You could try right-clicking on the filename, or the build drop-down menu. – Luke Aug 12 '13 at 18:45
4

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.

Kyohei Kaneko
  • 932
  • 2
  • 8
  • 25