本文地址:http://www.04007.cn/article/781.html

[root@04007 /]# cd /usr/local/
[root@04007 local]# 
[root@04007 local]# wget https://studygolang.com/dl/golang/go1.14.linux-amd64.tar.gz
--2020-03-05 20:51:54--  https://studygolang.com/dl/golang/go1.14.linux-amd64.tar.gz
2020-03-05 20:52:05 (19.6 MB/s) - “go1.14.linux-amd64.tar.gz” saved [123550266/123550266]
[root@04007 local]# tar zxvf go1.14.linux-amd64.tar.gz 
[root@04007 local]# mkdir /home/wwwroot/gopath/; cd /home/wwwroot/gopath/
[root@04007 gopath]# pwd
/home/wwwroot/gopath
[root@04007 gopath]# vim /etc/profile
#在最后添加以下几行
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=/home/wwwroot/gopath
[root@04007 gopath]# source /etc/profile
#此时go即安装成功
[root@04007 gopath]# go version
go version go1.14 linux/amd64
[root@04007 gopath]# mkdir src bin pkg
#将GO项目代码上传到src目录中
[root@04007 gopath]# cd src; rz
[root@04007 gopath]# go get github.com/astaxie/beego
[root@04007 gopath]# go get github.com/beego/bee
[root@04007 gopath]# go get github.com/go-sql-driver/mysql
本文地址:http://www.04007.cn/article/781.html,未经许可,不得转载.

本文地址:http://www.04007.cn/article/781.html 未经许可,不得转载. 手机访问本页请扫描右下方二维码.

手机扫码直接打开本页面