How to install go language in centos: 1. Obtain the go language source code package; 2. Unzip the source code package to the specified directory; 3. Check the path of the running program and add the path to the environment variable; 4. Test Whether the installation is successful.
The operating environment of this article: centos 7.5 system, GO 1.8.3, thinkpad t480 computer.
Specific method:
Get the source code package go1.8.3.linux-amd64.tar.gz
Unzip the source code package to the specified directory
tar -C /usr/local/ -zxf go1.8.3.linux-amd64.tar.gz
View the path of the running program
Add the path to the environment variable/etc/profile
[root@vm-122-218 bin]# source /etc/profile
[root@vm-122-218 bin]# go version
go version go1.8.3 linux/amd64
[root@vm-122- 218 bin]
#Create a test file, as shown below, the result can be correctly output
Related recommendations: golang tutorial
The above is the detailed content of How to install go language on centos. For more information, please follow other related articles on the PHP Chinese website!