Created
January 29, 2019 22:09
-
-
Save Eitol/a1069c947704dac37a654196e58c1868 to your computer and use it in GitHub Desktop.
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
## CONFIG | |
USR=`whoami` | |
SHARED_FOLDER=/home/${USR}/NAS | |
## GO CONFIG | |
GOVER='1.11.1' | |
GOPATH=/opt/go | |
GO_INSTALL_FOLDER=/usr/local/ | |
GOROOT=${GO_INSTALL_FOLDER}/go | |
# Install deps | |
sudo apt update -ybuild-essentials | |
sudo apt dist-upgrade -y | |
apt install git make build-essentials -y | |
# Install go | |
sudo mkdir -p ${GOPATH}/src | |
sudo mkdir -p ${GOPATH}/pkg | |
sudo mkdir -p ${GOPATH}/bin | |
curl -O https://dl.google.com/go/go${GOVER}.linux-amd64.tar.gz | |
tar xvf go${GOVER}.linux-amd64.tar.gz | |
sudo mv go ${GO_INSTALL_FOLDER} | |
sudo chown -R root:root ${GOROOT} | |
sudo chown -R ${USR} ${GOPATH} | |
mv go/bin/* ~/bin/ | |
mv go${GOVER}.linux-amd64.tar.gz ${SHARED_FOLDER} | |
sudo cat "export GOROOT=${GOROOT}" >> /etc/bashrc | |
export GOPATH=${GOPATH} | |
export PATH=$PATH:${GOROOT}/bin:${GOPATH}/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment