Skip to content

Instantly share code, notes, and snippets.

@sidxparab
Last active August 1, 2023 09:39
Show Gist options
  • Save sidxparab/e3856c5e27b8a9b27b5b4911eb9e4ae6 to your computer and use it in GitHub Desktop.
Save sidxparab/e3856c5e27b8a9b27b5b4911eb9e4ae6 to your computer and use it in GitHub Desktop.
Below are steps to install and configure a Go environment
#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