安装go语言环境
wget https://studygolang.com/dl/golang/go1.15.6.linux-amd64.tar.gz
tar -xvf go1.15.6.linux-amd64.tar.gz -C /usr/local/
#下载并解压到/usr/local下
配置环境变量
vi /etc/profile
export GOROOT=/usr/local/go
export GOPATH=/go/gopath #工作目录
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin #加入环境变量路径PATH
source /etc/profile
cd /go/gopath
mkdir bin pkg src
yum -y install git
#安装git和创建工作目录
安装goreman多进程管理工具
cd /go/gopath
go get github.com/mattn/goreman
#安装goreman
报错解决
package golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix": https fetch: Get "https://golang.org/x/sys/unix?go-get=1": dial tcp 216.239.37.1:443: i/o timeout
mkdir -p /go/gopath/src/golang.org/x
cd /go/gopath/src/golang.org/x
git clone https://github.com/golang/sys.git
goreman help
#测试命令