CentOS7使用yum安装golang方法
1、操作系统版本为centos7.5 64位

2、直接使用yum命令进行安装yum install golang

3、输入y并回车继续安装

4、安装完成之后使用go version进行验证

5、go命令已经加入到了/usr/bin中,不用在加入环境变量中了whereis go

6、编写hello.go代码内容如下[root@vm-122-243 ~]# cat hello.gopackage mainimport &鳎溻趄酃quot;fmt"func main() {fmt.Println("Hello, World!")}

7、运行代码,中间要加rungo run hello.go
