Skip to content

Instantly share code, notes, and snippets.

@openhoangnc
Last active January 24, 2018 11:54
Show Gist options
  • Select an option

  • Save openhoangnc/1bb591e8843ac111c0661f5615eda0e1 to your computer and use it in GitHub Desktop.

Select an option

Save openhoangnc/1bb591e8843ac111c0661f5615eda0e1 to your computer and use it in GitHub Desktop.
Install lastest golang
#!/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