Skip to content

Instantly share code, notes, and snippets.

@stewartjarod
Created September 21, 2014 21:22
Show Gist options
  • Save stewartjarod/167c544d4f0f4b231b5f to your computer and use it in GitHub Desktop.
Save stewartjarod/167c544d4f0f4b231b5f to your computer and use it in GitHub Desktop.
Quick GO Lang setup
# OS X Go Setup
# Install Go lang latest (1.3.1 as of Sept. 21, 2014)
###############################################################################
brew update
brew install hg
brew install go
# Set up Go lang workspace
mkdir -p ${HOME}/Projects/GO
mkdir -p ${HOME}/Projects/GO/src
mkdir -p ${HOME}/Projects/GO/pkg
mkdir -p ${HOME}/Projects/GO/bin
# Set environment variable
echo -e "\n# Set GOPATH environment variable to the Go lang workspace." >> ${HOME}/.zshrc
echo "export GOPATH=\$HOME/Projects/GO" >> ${HOME}/.zshrc
echo -e "\n# Add the Go Workspace's bin subdirectory to PATH." >> ${HOME}/.zshrc
echo "PATH=\$PATH:\$GOPATH/bin" >> ${HOME}/.zshrc
# Ensure GOPATH is set for the current shell session.
export GOPATH=$HOME/Projects/GO
export PATH=$PATH:$GOPATH/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment