Skip to content

Instantly share code, notes, and snippets.

@Eitol
Created January 29, 2019 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eitol/a1069c947704dac37a654196e58c1868 to your computer and use it in GitHub Desktop.
Save Eitol/a1069c947704dac37a654196e58c1868 to your computer and use it in GitHub Desktop.
## 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