Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hossinasaadi/3dde45310eaeb81aabe415a233b9c3e7 to your computer and use it in GitHub Desktop.
Save hossinasaadi/3dde45310eaeb81aabe415a233b9c3e7 to your computer and use it in GitHub Desktop.
Manage multiple versins of Go on MacOS with Homebrew

This process would likely apply to other Homebrew formula also.

First search for your desired package:

brew search go

You should get a list of results that include the below. Not "go" is very unspecific so you may get a lot of results:

Then install the desired version:

brew install [email protected]

Remember that you can have more than one package installed at the same time, but you cannot have them all available at the same time. So if you have the latest/generic go package already installed you need to unlink it first:

brew unlink go

And then you can link a different version:

In some cases you may need to link them with the --force and --overwrite options:

brew link --force --overwrite [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment