Build Go environment on ubuntu

post on

from Gist: oriverk/InstallLanguage2Ubuntu.md

Setup Golang

Use goenv to install Go.
goenv is package management tool which based on rbenv

git clone https://github.com/syndbg/goenv.git ~/.goenv
# make path
echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bashrc
echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(goenv init -)"' >> ~/.bashrc
# reload shell
exec $SHELL
# confirm goenv version
goenv --version
# check available Golang ver.
goenv install --list
# install Golang
goenv install x.x.x
# confirm available Golang ver.
goenv versions
# make the Golang ver. available to use as global
goenv global x.x.x
goenv rehash
# confirm Golang ver. that is available to use
go version

Reference

Others