Last active
January 24, 2018 11:54
-
-
Save openhoangnc/1bb591e8843ac111c0661f5615eda0e1 to your computer and use it in GitHub Desktop.
Install lastest golang
This file contains hidden or 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/sh | |
| #sudo curl https://gist.githubusercontent.com/openhoangnc/1bb591e8843ac111c0661f5615eda0e1/raw/51933d70dd3e384cca69c0fdd835f6243ad38d12/install_lastest_golang.sh | sh | |
| GOVERSION=1.9.3 | |
| GOOS=linux | |
| GOARCH=amd64 | |
| TARFILE=go$GOVERSION.$GOOS-$GOARCH.tar.gz | |
| TARFILEFULL=/tmp/$TARFILE | |
| PROFILE=/etc/profile.d/golang.sh | |
| wget https://storage.googleapis.com/golang/$TARFILE -o $TARFILEFULL | |
| rm -rf /usr/local/go | |
| tar -C /usr/local -xzvf $TARFILEFULL | |
| rm -f $TARFILEFULL | |
| echo 'export PATH=$PATH:/usr/local/go/bin:$(go env GOPATH)/bin' > $PROFILE | |
| export PATH=$PATH:/usr/local/go/bin:$(go env GOPATH)/bin | |
| go version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment