Go is a multi-purpose, statically typed programming language developed by Google in 2007. While it was built to act as a modern, high-performance replacement for C, it has carved out its own legacy as the backbone of modern cloud infrastructure.
Nowadays, Go is primarily used to build robust backends for applications requiring high concurrency and scalability. It is the language of choice for:
- Blockchain development
- Real-time communication systems
- Cloud-native services and microservices
- Machine Learning (for general-purpose tooling and data processing)
Go is cross-platform. Choose your operating system below to get started.
- Installation & Version Management: Check out a hassle-free Go installation and management guide
- MSI Installer:
Download the.msiinstaller from the official downloads page. Run it and follow the prompts. It will automatically configure your PATH. - Winget:
Open PowerShell and run:
winget install OpenJS.Gobrew install goDownload the .pkg file (Apple Silicon or Intel) from the official site and follow the installation wizard.
After installation, open a new terminal window and run:
go versionNote: You should see an output similar to
go version go1.x.x <os>/<arch>If you see"command not found", refer to the troubleshooting section below.
If your system cannot find the go command, you may need to manually configure your environment variables.
1. Understanding GOROOT and GOPATH
- GOROOT:
- The location where the Go SDK is installed. Modern versions of Go handle this automatically.
- GOPATH:
- Your personal workspace where your code and downloaded packages reside.
(Defaults to
~/go)
- Your personal workspace where your code and downloaded packages reside.
(Defaults to
2. Manual Path Setup
If the terminal returns an error, ensure the Go bin folder is in your system's PATH:
- Windows
Add the following to your Environment Variables → System Path:
C:\Program Files\Go\bin - macOS/Linux
Add these lines to your
~/.bashrcor~/.zshrc:export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:$(go env GOPATH)/bin
3. Quick Fixes
- Restart Terminal: Environment changes usually do not take effect until you restart your terminal or IDE.
- Permissions:
On Linux/macOS, ensure you have the correct permissions if installing to
/usr/local.