Skip to content

Instantly share code, notes, and snippets.

@rafecolton
Last active December 20, 2015 02:49
Show Gist options
  • Save rafecolton/6059284 to your computer and use it in GitHub Desktop.
Save rafecolton/6059284 to your computer and use it in GitHub Desktop.
Local Go Development with GVM
##################
# to install gvm #
##################
# install gvm
bash < <(curl -s https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) 2>/dev/null
# this should be done automatically, but we'll double check that it's there
! grep -q 'gvm' "$HOME/.bash_profile" && \
echo '[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"' >> ~/.bash_profile
# to start using gvm right away
source ~/.bash_profile
# update gvm if it's already installed
gvm update
# install go1.1.1
gvm install go1.1.1 2>/dev/null
# add gvm version preference to .bash_profile
! grep -q 'gvm use go1.1.1' "$HOME/.bash_profile" && \
echo 'gvm use go1.1.1 >/dev/null' >> ~/.bash_profile
gvm use go1.1.1
###################################
# using gvm for local development #
###################################
# You'll want to link your go projects into your `src` directory
# so `go install` can find the local copies instead of what's on GitHub.
# For example, with a namespace of `github.com/modcloth-labs/mithril`
cd ~/workspace/<project-name>
gvm linkthis "github.com/<github-org>/<project-name>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment