On this page
Installing Go (Golang)
Linux (using yum
for CentOS/RHEL and apt
for Debian/Ubuntu)
Using yum
(CentOS/RHEL):
-
Install Go using
yum
:sudo yum install golang
-
Verify the installation:
go version
Using apt
(Debian/Ubuntu):
- Update the package index:
sudo apt update
- Install Go using apt:
sudo apt install golang
- Verify the installation:
go version
Windows
-
Download the installer:
- Visit the official Go website and download the installer for Windows.
-
Run the installer:
- Double-click the downloaded
.msi
installer file and follow the on-screen instructions.
- Double-click the downloaded
-
Set up environment variables:
- Go should automatically add itself to the PATH during installation.
-
Verify the installation:
- Open Command Prompt or PowerShell and type:
go version
macOS
-
Install Go using Homebrew (optional):
- If you prefer using Homebrew, run:
brew install golang
-
Download the macOS package:
- Visit the official Go website and download the macOS package.
-
Run the package installer:
- Double-click the downloaded
.pkg
file and follow the on-screen instructions.
- Double-click the downloaded
-
Verify the installation:
- Open Terminal and type:
go version