How to install Go?
Created Jan 17, 2024Last modified Jan 17, 2024
macOS
- Open a terminal.
- You can use Homebrew to install Go. If you don't have Homebrew installed, you can install it from brew.sh.
- Run the following command to install Go:
brew install go
- Verify the installation by checking the Go version:
go version
Linux
- Open a terminal.
- You can use the package manager for your distribution to install Go.
For example, on Debian-based systems (like Ubuntu), you can use:
sudo apt-get update
sudo apt-get install golang
On Red Hat-based systems (like Fedora), you can use:
sudo yum install golang
- Verify the installation:
go version
Windows
- Download the Go installer for Windows from the official Go Downloads page.
- Run the installer executable (.msi file) and follow the installation prompts.
- After the installation is complete, open a Command Prompt or PowerShell and verify the installation:
go version