Skip to content

Instantly share code, notes, and snippets.

@toddlers
Created July 23, 2013 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddlers/6063016 to your computer and use it in GitHub Desktop.
Save toddlers/6063016 to your computer and use it in GitHub Desktop.
setting up golang on mac osx
# OS X Go Setup
# Assumes:
# + Homebrew has been installed correctly.
# + Homebrew-cask has been tapped and installed correctly.
# Install Go lang latest (1.1.1 as of May 13, 2013)
###############################################################################
brew install go
# Set up Go lang workspace
mkdir -p ${HOME}/Workspace/go-workspace
mkdir -p ${HOME}/Workspace/go-workspace/src
mkdir -p ${HOME}/Workspace/go-workspace/pkg
mkdir -p ${HOME}/Workspace/go-workspace/bin
# Set environment variable
echo -e "\n# Set GOPATH environment variable to the Go lang workspace." >> ${HOME}/.bash_profile
echo "GOPATH=\$HOME/Workspace/go-workspace:\$GOPATH" >> ${HOME}/.bash_profile
# Ensure GOPATH is set for the current shell session.
export GOPATH=$HOME/Workspace/go-workspace:$GOPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment