Skip to content

Instantly share code, notes, and snippets.

@fd98279
Last active December 6, 2018 13:13
Show Gist options
  • Save fd98279/ab28361fd6eba72028ca40cc0b1a0bea to your computer and use it in GitHub Desktop.
Save fd98279/ab28361fd6eba72028ca40cc0b1a0bea to your computer and use it in GitHub Desktop.
To setup go development environment
# Based on instructions at https://golang.org/doc/code.html
# Get latest go build
wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz
tar -xvf go1.11.2.linux-amd64.tar.gz
sudo mv go /usr/local
# Add to ~/.bashrc and ~/.profile (requried by VSCode)
export GOROOT=/usr/local/go
# Location where all the go source code will reside
mkdir -p $HOME/Workspace/repos/go
mkdir -p $HOME/Workspace/repos/go/{src,bin}
export GOPATH=$HOME/Workspace/repos/go
# Location where go will save the binaries built
export GOBIN=${GOPATH}/bin
# Add binaries location to PATH
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
source ~/.profile
go version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment