0

I've set up go (golang) on my Linux Mint (Ubuntu) box using gvm (Go Version Manager).

I've started a project, but I can't get it to build from within LiteIDE.

go build -i [/home/username/go/src/projectname]
Error: process failed to start.

If I open a terminal and cd to the project's location and do a go build it works just fine. My go env seems to work just fine outside of liteide.

Zamicol
  • 4,626
  • 1
  • 37
  • 42

1 Answers1

2

The GOROOT is not set correctly in LiteIDE.

In a terminal enter which go to know where gvm installed go. Example:

/home/username/.gvm/gos/go1.6/bin/go

In LiteIDE, click on the grey box "edit current environment" right of the environment drop down menu.

LiteIDE drop down menu

Uncomment the GOROOT line in the system.env file and enter the correct path that you got from which go. You omit "/bin/go".

GOROOT=/home/username/.gvm/gos/go1.6

Save the file. If saving is greyed out, you might need to change the permission of LiteIDE's liteenv directory. I installed mine to /opt/liteide/share/liteide/liteenv.

When the settings are configured correctly, this is what you should see in LiteIDE's Build Output window:

/home/username/.gvm/gos/go1.6/bin/go build -i [/home/username/go/src/project] Success: process exited with code 0. /home/username/go/src/bad/bad [/home/username/go/src/project] Hello World! Success: process exited with code 0.

Instead of using the system environment config (the default in the drop down menu) I'm personally using the linux64-local.env file. My LiteIDE config file looks like this:

# native compiler linux amd64

GOROOT=/home/username/.gvm/gos/go1.6
#GOBIN=
GOARCH=amd64
GOOS=linux
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/gnome-terminal
LITEIDE_TERMARGS=
LITEIDE_EXEC=/usr/bin/xterm
LITEIDE_EXECOPT=-e

LITEIDE_SHELL=gnome-terminal;lxterminal;kconsole;xfce4-terminal;xterm
Zamicol
  • 4,626
  • 1
  • 37
  • 42