Last active
February 23, 2016 22:24
-
-
Save mohae/8dd3e49e9351460467b7 to your computer and use it in GitHub Desktop.
Installs the current release of Go
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
#!/bin/bash | |
# For more info see https://golang.org/doc/install.html, the instructions there are all | |
# that is needed to install Go. | |
# | |
# DO NOT RUN with SUDO; Go should be installed under the user not root. Using sudo will | |
# cause problems. This script will install Go to /usr/local/go and create your workspace | |
# in your home directory: $HOME/go. | |
# | |
# The workspace is where all of the Go code will exist. Place your code in a subdirectory | |
# of $HOME/go/src. If you want your Go code (workspace) in a different location, change | |
# both the mkdir line and GOPATH to the location of your user's workspace. | |
# | |
# Please see https://golang.org/doc/code.html for more information about code organization. | |
mkdir ~/go | |
echo export 'GOPATH=$HOME/go' >> ~/.bashrc | |
echo export 'PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.bashrc | |
source ~/.bashrc | |
# download and extract Go to /usr/local/go/ | |
# change the tarball for different version/arch | |
wget -qO- https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | sudo tar xz -C /usr/local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment