Try to do a manual installation, entirely in your $HOME
(that way, root
is never involved, and you won't have to do any sudo
.
mkdir ~/golang
cd ~/golang
wget https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz
tar -xzf go1.3.1.linux-amd64.tar.gz
Add the following lines to your ~/.bashrc
file:
export GOROOT=$HOME/golang/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=~/golang/yourProjects
Then
mkdir -p ~/golang/yourProjects/src
And you can start playing with ~/golang/yourProjects/src/hello.go
.
See more about go workspace (the folder referenced by $GOPATH
) in "How to Write Go Code".