Home > Article > Backend Development > Detailed explanation of the installation tutorial of Golang 1.9 (under Windows system)
Golang is a new programming language that is fast, safe and simple. Because of these features, it is favored by many programmers. If you want to start Golang programming, you first need to install the Golang environment. This article will introduce you to the specific steps to install the Golang 1.9 environment under Windows systems.
First, we need to download the Golang installation file from the official website. Before downloading, we must first confirm the basic information and version of our computer system. At the same time, please download the installation package suitable for your operating system and CPU architecture. For example, in our Windows system:
After the download is complete, install it. Please open the download directory and double-click the "go1.9.windows-amd64.msi" or "go1.9.windows-386.msi" file to perform the installation operation. In the pop-up "Golang Installation Wizard", we can click "Next" all the way to complete the installation and wait for the installation program to be automatically executed.
3.1 Configure running environment variables
After the installation is completed, we need to configure the environment variables, that is, add Golang to the system environment variables .
Method 1: Manually configure the system environment variables
We can manually configure the environment variables through the following steps:
go version
to verify whether the installation is successful. Method 2: Use a script to automatically configure environment variables
In Windows systems, you can automatically configure environment variables through the following script. The following script is suitable for 64-bit systems. If you need to use 32-bit systems, bit system, please change the c:\Go
path to the path you actually installed.
$old = (Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment\').Path $new = "$old;c:\Go\bin" Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $new $env:Path = $new
After the above script is executed, reopen the Windows command line tool and execute the command go version
to verify whether the installation is successful.
After the installation is completed, we can verify whether the Golang environment is ready through the following command:
go version
After successful execution , will return Golang version number information. If the go command is not found, check whether the running environment variables are configured correctly.
At this point, the installation process of Golang 1.9 has ended. I hope this tutorial can help you successfully install the Golang environment and start your Golang programming journey.
The above is the detailed content of Detailed explanation of the installation tutorial of Golang 1.9 (under Windows system). For more information, please follow other related articles on the PHP Chinese website!