Created
September 14, 2015 11:47
-
-
Save vamdt/0d4c3e1a9b454a445b72 to your computer and use it in GitHub Desktop.
go update script
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
#!/usr/bin/env bash | |
usage() { | |
printf 'go-update.sh go$VERSION.$OS-$ARCH.tar.gz\n' | |
exit 1 | |
} | |
[ -z "$1" ] && usage | |
go_pkg_name="$1" | |
cd $(dirname $0) | |
printf "Download go package...\n" | |
wget -P /tmp "https://storage.googleapis.com/golang/$go_pkg_name" | |
#cp ~/temp/go1.5.1.linux-amd64.tar.gz /tmp | |
printf "Delete old go dir: /usr/local/go \n" | |
sudo rm -rf /usr/local/go | |
printf "Extract go packaget to /usr/local \n" | |
sudo tar -C /usr/local -xzf "/tmp/$go_pkg_name" | |
printf "Done \n" | |
go version | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment