Skip to content

Instantly share code, notes, and snippets.

@random-robbie
Last active December 14, 2021 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save random-robbie/06593ef486a7cd0d214205d2d74433dd to your computer and use it in GitHub Desktop.
Save random-robbie/06593ef486a7cd0d214205d2d74433dd to your computer and use it in GitHub Desktop.
install golang
#!/bin/bash
echo 'Installing go...'
wget https://dl.google.com/go/go1.17.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz
rm go1.17.linux-amd64.tar.gz
mkdir $HOME/go
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
@random-robbie
Copy link
Author

random-robbie commented Feb 14, 2019

curl -l https://gist.github.com/random-robbie/06593ef486a7cd0d214205d2d74433dd/raw/go.sh | sh

@random-robbie
Copy link
Author

wget https://dl.google.com/go/go1.17.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.5.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
source ~/.bash_profile
mkdir -p $HOME/go
mkdir -p $HOME/go/src
mkdir -p $HOME/go/bin
mkdir -p $HOME/go/pkg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment