Skip to content

Instantly share code, notes, and snippets.

@liuyangc3 liuyangc3/golang .bashrc forked from vsouza/.bashrc
Last active Dec 25, 2015

Embed
What would you like to do?
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
# Set variables in .zshrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
echo "Please enter your golang path (ex: $HOME/golang) :"
read gopath
echo "Please enter your github username (ex: vsouza) :"
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 update
brew install go
brew install git
brew install mercurial
go get golang.org/x/tools/cmd/godoc
go get golang.org/x/tools/cmd/vet
echo "go to https://golang.org/doc/code.html and enjoy :D"
# install lite IDE
brew install qt
export QTDIR=/usr/local/Cellar/qt/4.x
git clone https://github.com/visualfc/liteide.git
cd liteide/build
./update_pkg.sh
./build_osx.sh
./deploy_osx_qt4.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.