Install Go
This guide will help you install Go language on different operating systems.
Choose Your Operating System
Select the operating system you are using:
System Requirements
Before installing Go, please ensure your system meets the following minimum requirements:
Windows
- Windows 7 or later
- 64-bit or 32-bit processor
macOS
- macOS 10.13 (High Sierra) or later
- Intel or Apple Silicon processor
Linux
- Any mainstream Linux distribution
- 64-bit or 32-bit processor
Download Go
Visit the official download page to download the Go installation package suitable for your system.
Installation Overview
The Go installation process is simple and straightforward:
- Download: Download the installation package suitable for your system
- Install: Follow the installation wizard or extract the archive
- Configure: Set up environment variables (GOROOT, GOPATH, PATH)
- Verify: Run
go versionto verify the installation
Environment Variables
After installation, you may need to configure the following environment variables:
GOROOT
Specifies the Go installation directory. By default:
- Windows:
C:\Go - macOS/Linux:
/usr/local/go
GOPATH
Specifies the Go workspace directory. By default:
- Windows:
%USERPROFILE%\go - macOS/Linux:
$HOME/go
PATH
Add the following to the PATH environment variable:
%GOROOT%\binor$GOROOT/bin%GOPATH%\binor$GOPATH/bin
Verify Installation
After installation is complete, open a terminal or command prompt and execute:
go versionIf the installation is successful, you should see output similar to:
go version go1.21.3 windows/amd64Next Steps
After installation is complete, you can:
- Learn Go basics: Visit Go Getting Started Guide
- Write your first program: Create a simple Hello World program
- Explore the standard library: Learn about Go's rich standard library
- Join the community: Participate in the Go community and get help
Troubleshooting
If you encounter issues during installation, please check:
- System compatibility: Ensure your system meets the minimum requirements
- Permissions: Ensure you have sufficient permissions to install software
- Environment variables: Ensure environment variables are configured correctly
- Network connection: Ensure you can access the Go official website
For more detailed troubleshooting information, please visit the installation guide for your specific operating system.
