YouTip LogoYouTip

Go Environment

# Go Environment Installation Go supports the following systems: * Linux * FreeBSD * Mac OS X (also known as Darwin) * Windows The download address for the installation packages is: [https://go.dev/dl/](https://go.dev/dl/). If you cannot access it, you can use this address: [https://golang.google.cn/dl/](https://golang.google.cn/dl/). !(#) Package names for each system: | Package Filename | Applicable System | Processor Architecture | System Version Requirement | Description | | --- | --- | --- | --- | --- | | `go1.26.3.windows-amd64.msi` | Microsoft Windows | x86-64 (Intel 64-bit) | Windows 10 or newer | Graphical installer for Windows 64-bit systems | | `go1.26.3.darwin-arm64.pkg` | Apple macOS | ARM64 (Apple Silicon 64-bit) | macOS 12 or newer | Installer for Macs with M-series chips (including your Mac mini 4) | | `go1.26.3.darwin-amd64.pkg` | Apple macOS | x86-64 (Intel 64-bit) | macOS 12 or newer | Installer for older Macs with Intel processors | | `go1.26.3.linux-amd64.tar.gz` | Linux | x86-64 (Intel 64-bit) | Linux 3.2 or newer | Archive for most 64-bit Linux systems | | `go1.26.3.src.tar.gz` | Any system | Source Code | - | Go language source code package, requires compilation | * * * ## UNIX/Linux/Mac OS X, and FreeBSD Installation The following describes the source code installation method on UNIX/Linux/Mac OS X, and FreeBSD systems: 1. Download the binary package: go1.4.linux-amd64.tar.gz. 2. Extract the downloaded binary package to the /usr/local directory. tar -C /usr/local -xzf go1.4.linux-amd64.tar.gz 3. Add the /usr/local/go/bin directory to the PATH environment variable: export PATH=$PATH:/usr/local/go/bin The above only adds PATH temporarily; it will be gone when you close the terminal and log in next time. We can edit ~/.bash_profile or /etc/profile, and add the following command to the end of the file to make it permanent: export PATH=$PATH:/usr/local/go/bin After adding, you need to execute: source ~/.bash_profile or source /etc/profile > **Note:** On MAC systems, you can use the installer package ending with **.pkg** and double-click it to complete the installation. The installation directory is under **/usr/local/go/**. * * * ## Windows System Installation On Windows, you can use the installer package with the .msi suffix (you can find this file in the download list, e.g., go1.4.2.windows-amd64.msi) to install. By default, the **.msi** file will be installed in the **c:Go** directory. You can add the **c:Gobin** directory to the **Path** environment variable. After adding, you need to restart the command window for it to take effect. ### Installation Test Create a working directory **C:>Go_WorkSpace**. ## test.go File Code: package main import"fmt" func main(){ fmt.Println("Hello, World!") } Execute the above code using the go command, and the output will be: C:Go_WorkSpace>go run test.go Hello, World!
← Go If Else StatementGo Decision Making β†’