Last active
August 1, 2023 09:39
-
-
Save sidxparab/e3856c5e27b8a9b27b5b4911eb9e4ae6 to your computer and use it in GitHub Desktop.
Below are steps to install and configure a Go environment
This file contains hidden or 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
#Download the Go binary | |
wget https://golang.org/dl/go1.20.4.linux-amd64.tar.gz | |
#Remove previous golang installation and extract the new one | |
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.4.linux-amd64.tar.gz | |
#Create symlink | |
ln -sf /usr/local/go/bin/go /usr/local/bin/ | |
#Add these line to your terminal config file(.bashrc/.zshrc) | |
export GOROOT=/usr/local/go | |
export GOPATH=$HOME/go | |
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH | |
#Source your terminal (or restart terminal) | |
source $HOME/.bashrc <or> source $HOME/.zshrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment