Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I update golang from command prompt on Windows?

Tags:

I have 1.7 version of golang and I want to update golang to 1.8 from command prompt. Uninstalling and Installing it again is always an option, but can I update it using commands on Windows 8.1?

like image 898
Saransh Avatar asked Apr 23 '17 09:04

Saransh


People also ask

How do you update the Go?

New versions of Go are hosted on the golang.org website here: https://golang.org/dl/. Always download your go version from this official URL. To update your current version, download on this website the targeted version.


2 Answers

Go can also be updated using the Chocolatey package manager. Run from an elevated shell to minimize the risk of installation issues.

Install using:

choco install golang -y 

Update using:

choco upgrade golang -y 
like image 125
David Avatar answered Nov 12 '22 16:11

David


I think that GVM could be a good option for that. GVM is an interface to manage Go versions in your computer. It allows you to change the Go version and even installing/uninstalling different golang versions by command prompt.

You can install a new version by typing:

gvm install go1.4 -B gvm use go1.4 export GOROOT_BOOTSTRAP=$GOROOT gvm install go1.5 

Or even get a list of golang versions installed in your computer:

gvm list 

More information can be found on their website: https://github.com/moovweb/gvm

like image 32
Goma_BR Avatar answered Nov 12 '22 15:11

Goma_BR