If you want to install GoLang on WSL/WSL2 and setup your development environment, please follow these steps
You can check latest Go Version for any OS like: Linux, macOS or Windows at https://go.dev/dl/
At the time of writing this blog, the most recent LTS version of Go is 1.18.3.
sudo tar -xvf go1.18.3.linux-amd64.tar.gz
sudo mv go /usr/local
You have to edit .bashrc file before making further changes, you can follow below steps to open .bashrc file
Open .bashrc file and add following lines at the bottom and save the file.
Refresh your terminal using **bash **command
Make sure it returns the same version that you installed.