Home >Backend Development >Golang >golang+1.6+ installation
When developing in Go language, a good start is to correctly install the latest version of Go language and development environment. This article will introduce how to install Go language version 1.6 on Windows and Linux systems.
1. Windows system installation
1. Download the installation package: First, you need to download the Go language installation program from the official website (https://golang.org/dl/). Choose the version that suits your operating system, you can also choose the 32-bit or 64-bit version depending on your operating system.
2. Run the installer: Once you have downloaded the program, double-click the run file and follow the prompts to install. By default, the Go language will be installed in the C:Go directory. You can change the installation directory, but make sure you select the correct directory during installation.
3. Add environment variables: After the installation is complete, you need to add the binary file path of the Go language to your system path. You can complete it by following the steps:
4. Test the installation successfully: Open the command prompt and enter "go version" to view the version number. If you see the version number of the Go language displayed, it means the installation is successful.
2. Linux system installation
1. Download the installation package: You can download the Linux version of Go language from the official website (https://golang.org/dl/) through the command line . Choose the version that suits your operating system, you can also choose the 32-bit or 64-bit version depending on the operating system. For example, the command to download the 64-bit version of Linux system is as follows:
wget https://dl.google.com/go/go1.6.linux-amd64.tar.gz
2 , Unzip the installation package: After the download is complete, you need to unzip the file and install it into your system. You can use the following command to decompress the downloaded file:
tar -C /usr/local/ -xzf go1.6.linux-amd64.tar.gz
3. Add environment variables: You need to add the Go binary path to your system path. You can do this by editing your .bashrc file. And add PATH at the end of the variable value.
export PATH=$PATH:/usr/local/go/bin
Execute the following command to make the environment variable take effect:
source ~/.bashrc
4. Test the installation successfully: Open the terminal and enter "go version" to view the version number. If you see the version number of the Go language displayed, it means the installation is successful.
3. Summary
In this article, we introduce in detail how to install Go language 1.6 on Windows and Linux systems. By properly installing the Go language and setting environment variables, you can start developing and writing programs using the Go language. I wish you success!
The above is the detailed content of golang+1.6+ installation. For more information, please follow other related articles on the PHP Chinese website!