Upgrading or Downgrading Go - Practical Go Lessons-40
Upgrading or Downgrading Go - Practical Go Lessons-40
com/chap-40-upgrading-or-downgrading-go
$ go version
The version is printed with the reference of your system (in my case Apple MacOS)
The paper and the digital edition of this book are available here. ×
I also filmed a video course to build a real world project with Go.
$ which go
Wich will locate the program file in the user path (cf. man which)
Usually (Linux and Mac users), if you type this on your system, it will display :
/usr/local/go/bin/go
For windows users, the path where the go binaries are stored is usually.
C:\Go\bin
1 of 4 02/01/2023, 02:24
Upgrading or Downgrading Go - Practical Go Lessons https://www.practical-go-lessons.com/chap-40-upgrading-or-downgrading-go
c:\> where go
To update your current version, download on this website the targeted version.
To be sure that you have downloaded a valid binary, you have to compute the SHA256 sum of the downloaded file. Then you have to
ensure that it is strictly equal to the one that is listed on the website (see 1).
5.0.0.1 On macOS
To check a sha256 sum, open a terminal and type :
The a flag is used to indicate which algorithm to use (here it’s SHA256)
5.0.0.2 On Linux
The command is shorter :
$ sha256sum go1.11.2.linux-amd64.tar.gz
5.0.0.3 On Windows
You can use certutil to do so on the command prompt
6.2 On Linux
6.2.0.0.1 Archive extraction
First, you have to extract the archive downloaded with the following command :
2 of 4 02/01/2023, 02:24
Upgrading or Downgrading Go - Practical Go Lessons https://www.practical-go-lessons.com/chap-40-upgrading-or-downgrading-go
The bin directory contains two executables files at the time of writing :
• go
• gofmt
export PATH=$PATH:/usr/local/go/bin
After that, you will need to restart your terminal for the change to take effect.
6.3 On Windows
You downloaded an installer. it will automatically install the selected version. Just double-click on the file downloaded.
Bibliography
Previous Next
Table of contents
Did you spot an error ? Want to give me feedback ? Here is the feedback page! ×
Newsletter:
Like what you read ? Subscribe to the newsletter.
@ my@email.com
Practical Go Lessons
By Maximilien Andile
Copyright (c) 2023
Follow me Contents
3 of 4 02/01/2023, 02:24
Upgrading or Downgrading Go - Practical Go Lessons https://www.practical-go-lessons.com/chap-40-upgrading-or-downgrading-go
Posts
Book
Support the author Video Tutorial
About
The author
Legal Notice
Feedback
Buy paper or digital copy
Terms and Conditions
4 of 4 02/01/2023, 02:24