Sunday, December 3, 2023
HomeSoftware EngineeringThe way to Set up Golang on WSL/WSL2

The way to Set up Golang on WSL/WSL2

If it’s essential set up Golang on WSL underneath Home windows 10 or larger, you possibly can comply with these few steps.

First take away any outdated variations mendacity round

sudo rm -rf /usr/native/go* && sudo rm -rf /usr/native/go

Decide the most recent Go model

Go to and discover out what the most recent model is. On the time of penning this, Go is on model 1.16.

Set up Go

Be certain that to interchange 1.16 under with the up to date model as required.


cd $HOME
tar -xvf go$VERSION.$OS-$ARCH.tar.gz
mv go go-$VERSION
sudo mv go-$VERSION /usr/native

Add Go to your atmosphere profile

Open ~/.bashrc and add the next. Keep in mind to replace the 1.16 to the model you put in.

export GOROOT=/usr/native/go-1.16
export GOPATH=$HOME/tasks/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$HOME/tasks/go/bin

You’ll now have the ability to run Go by typing go within the WSL terminal.



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments