Skip to content

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:

  1. Download: Download the installation package suitable for your system
  2. Install: Follow the installation wizard or extract the archive
  3. Configure: Set up environment variables (GOROOT, GOPATH, PATH)
  4. Verify: Run go version to 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%\bin or $GOROOT/bin
  • %GOPATH%\bin or $GOPATH/bin

Verify Installation

After installation is complete, open a terminal or command prompt and execute:

bash
go version

If the installation is successful, you should see output similar to:

go version go1.21.3 windows/amd64

Next Steps

After installation is complete, you can:

  1. Learn Go basics: Visit Go Getting Started Guide
  2. Write your first program: Create a simple Hello World program
  3. Explore the standard library: Learn about Go's rich standard library
  4. Join the community: Participate in the Go community and get help

Troubleshooting

If you encounter issues during installation, please check:

  1. System compatibility: Ensure your system meets the minimum requirements
  2. Permissions: Ensure you have sufficient permissions to install software
  3. Environment variables: Ensure environment variables are configured correctly
  4. 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.

Additional Resources

Golang by www.golangdev.cn edit