Go Installation Guide
This guide provides comprehensive instructions for installing Go on macOS and Windows. GSwarm requires Go 1.24+ to build and run.
🔧 Go Installation Instructions
macOS
Option 1: Using Homebrew (Recommended)
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Go
brew install go
# Verify installation
go version
Option 2: Manual Installation
# Download Go for macOS
curl -O https://go.dev/dl/go1.24.0.darwin-amd64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.darwin-amd64.tar.gz
# Add to PATH (add to ~/.zshrc or ~/.bash_profile)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.zshrc
source ~/.zshrc
# Verify installation
go version
Local PC (Windows)
Option 1: Using Chocolatey
# Install Chocolatey if you don't have it
# Run PowerShell as Administrator and execute:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install Go
choco install golang
# Verify installation
go version
Option 2: Using Scoop
# Install Scoop if you don't have it
# Run PowerShell and execute:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
# Install Go
scoop install go
# Verify installation
go version
Option 3: Manual Installation
- Download Go for Windows from https://go.dev/dl/ (opens in a new tab)
- Run the installer and follow the prompts
- Open Command Prompt or PowerShell and verify:
go version
Setting Up Go Environment
After installing Go, set up your environment:
# Set GOPATH (optional, Go 1.11+ uses modules by default)
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc
# Verify Go environment
go env GOPATH
go env GOROOT
Verifying Installation
After installation, verify everything is working:
# Check Go version (should be 1.24+)
go version
# Check Go environment
go env
# Test Go installation
mkdir test-go && cd test-go
go mod init test
echo 'package main
import "fmt"
func main() {
fmt.Println("Hello, Go!")
}' > main.go
go run main.go
# Should output: Hello, Go!
🐛 Troubleshooting
Common Issues
"go: command not found"
- Ensure Go is installed and in your PATH
- Check your shell profile file (~/.bashrc, ~/.zshrc, etc.)
- Restart your terminal after installation
"Permission denied" on macOS/Linux
- Use
sudo
for system-wide installation - Or install to your home directory and add to PATH
Windows PATH issues
- Ensure Go is added to your system PATH
- Restart Command Prompt/PowerShell after installation
- Check Environment Variables in System Properties
Version too old
- GSwarm requires Go 1.24+
- Update Go using your package manager or download the latest version
Getting Help
If you encounter issues with Go installation:
- Check Go Documentation: https://go.dev/doc/install (opens in a new tab)
- Verify Installation: Run
go version
andgo env
- Check PATH: Ensure Go binaries are in your system PATH
- Restart Terminal: Close and reopen your terminal after installation
📚 Additional Resources
- Official Go Installation Guide (opens in a new tab)
- Go Environment Variables (opens in a new tab)
- Go Modules (opens in a new tab)
- Go Workspaces (opens in a new tab)
🔗 Next Steps
After installing Go, you can proceed with installing GSwarm.
📖 Additional Installation Options
For installation instructions on other operating systems and distributions (CentOS, Fedora, Arch Linux, Alpine Linux, BSD systems, ARM-based systems, containers, and cloud platforms), see our Advanced Go Installation Guide.