on 2019-06-14

gvm

Intro

gvm

Golang version manger

Usage

  1. Install
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
  1. Add to .bashrc or .zshrc
# added gvm command to shell
source "$HOME/.gvm/scripts/gvm"
# directory path for GO
export GOPATH=$HOME/gopath
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
  1. Install go
gvm install go1.4 -B
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
gvm install go1.9
  1. Finall add command to .bashrc or .zshrc
gvm use go1.9

Refer - Go - 在 OSX 安裝 GVM