Skip to content

Instantly share code, notes, and snippets.

@abdulhalim-cu
Last active April 30, 2021 10:19
Show Gist options
  • Save abdulhalim-cu/66c2b873ab09afb26f063918e411512a to your computer and use it in GitHub Desktop.
Save abdulhalim-cu/66c2b873ab09afb26f063918e411512a to your computer and use it in GitHub Desktop.
#go to your home directory and get the golang tarball using curl
cd ~
#change "go1.16.3" to whatever version you want
curl -O https://dl.google.com/go/go1.16.3.linux-amd64.tar.gz
#extract the download using tar and move to /user/local
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
#set up your go paths
sudo nano ~/.bashrc
#add these at the end of the file
#change "$HOME/go" to wherever you will be doing your projects
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
#save the file and exit
#apply the changes to your terminal
source ~/.bashrc
#you're good to Go :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment