Best Golang installation

Best way to install Golang, from:

Assuming you already have the correct environment and you are on an ubuntu workstation.

  • Download and install godeb if you haven’t already done.
  • Then with godeb list and godeb install install your favourite Go version (the last, obviously!:P).
  • To be able to cross-compile with the new installed Go:
sudo -i
cd /usr/local/go/src
git clone git://github.com/davecheney/golang-crosscompile.git
source golang-crosscompile/crosscompile.bash
go-crosscompile-build-all

done.

If you need a non-root installation or want to do everything from scratch it is just easy as:

git clone https://go.googlesource.com/go
cd go
git checkout go1.4.1 # or the latest release
cd src
./all.bash
git clone git://github.com/davecheney/golang-crosscompile.git
source golang-crosscompile/crosscompile.bash
go-crosscompile-build-all
cd ../../
mv go goroot
mkdir -p gopath/bin
mkdir -p gopath/docs
mkdir -p gopath/pkg
mkdir -p gopath/src/github.com/$USER # here you will put your github project sources
echo "export GOROOT=/home/$USER/goroot" >> ~/.bashrc
echo "export GOPATH=/home/$USER/gopath" >> ~/.bashrc
echo "export PATH=$PATH:$GOROOT/bin:$GOPATH/bin" >> ~/.bashrc
Tags// , ,
More Reading
Older// Cool Websites
comments powered by Disqus