Skip to content

Instantly share code, notes, and snippets.

@tors
Created February 29, 2016 05:45
Show Gist options
  • Save tors/1504e7ae73810c270f60 to your computer and use it in GitHub Desktop.
Save tors/1504e7ae73810c270f60 to your computer and use it in GitHub Desktop.
echo "Please enter your golang path (ex: $HOME/Go) :"
read gopath
echo "Please enter your github username:"
read user
mkdir $gopath
mkdir -p $gopath/src/github.com/$user
export GOPATH=$gopath
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
command -v brew >/dev/null 2>&1 || { ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" }
brew install go
go get golang.org/x/tools/cmd/godoc
echo "good to go!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment