Last active
December 6, 2018 13:13
-
-
Save fd98279/ab28361fd6eba72028ca40cc0b1a0bea to your computer and use it in GitHub Desktop.
To setup go development environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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