I’ve installed golang-stable using the Go Language ppa for Ubuntu.
The Official Installation Instructions seem to ignore this option, and don’t mention it at all.
My question is: does anyone know if anything else is needed after doing the sudo apt-get for this package? In particular, do I have to manually set any environment variables?
I’m asking because I’ve been able to “go get” Go-SDL, but when I try to execute its test I get the following error:
$ ./test
panic: No such environment variable: GOPATH
This kind of confuses me. Shouldn’t that variable be initialized already? Especially given that I have been able to compile and install a library.
The
gocommand that you installed in/usr/lib/go/bin/internally contains a default path that is used if the environment variableGOPATHis missing. In case of the Ubuntu package this default path points to/usr/lib/go. Thus the installation directory for Go-SDL is somewhere in/usr/lib/go/src. Installing Go-SDL in this way requires root priviledges.I recommend you setup
GOPATHas described in http://golang.org/doc/code.html and reinstall Go-SDL. For example:The
testfromgithub.com/0xe2-0x9a-0x9b/Go-SDLneeds to knowGOPATHto find some resource files (based on How to access resource files after the 'go' tool installed the executable?).