From charlesreid1

Goenv is like pyenv or rbenv but for Go

git clone https://github.com/syndbg/goenv.git ~/.goenv

Now add .goenv to your path in .bash_profile so goenv is a command

vim ~/.bash_profile

Add the lines:

export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"

Now log out and log back in.

To prepare your path to use goenv's version of go, initialize it:

eval "$(goenv init -)"

List versions of go to install:

goenv install -l

Install version 1.7.5:

goenv install 1.7.5

Switch the global version to this installed version:

goenv global 1.7.5

You should see a version of go shimmed onto your path:

$ which go
/home/charles/.goenv/shims/go