Last active
December 14, 2021 13:13
-
-
Save random-robbie/06593ef486a7cd0d214205d2d74433dd to your computer and use it in GitHub Desktop.
install golang
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
#!/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 |
Author
random-robbie
commented
Feb 14, 2019
•
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