# 准备Hoverfly编译环境

1. 配置GO环境变量。

  a. 打开“/etc/profile”文件。
    1 vim /etc/profile

  b. 按“i”进入编辑模式，添加如下内容。

```
export GOPATH=/root/go;
export GOROOT=/usr/lib/golang;
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
```


  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
  d. 使修改的环境变量生效。
    1 source /etc/profile

2. 安装Gox、Logrus、Goproxy和Glide。
  1 2 3 4 5 git config --global http.sslVerify false go get github.com/mitchellh/gox; go get github.com/Sirupsen/logrus; go get github.com/rusenask/goproxy; go get github.com/Masterminds/glide;

3. 查看Glide版本。

```
glide -v
```


  如果回显报错“command not found”，则输入reboot命令重启服务器。

4. 修改Git配置文件。

  a. 打开“~/.gitconfig”文件。
    1 vim ~/.gitconfig

  b. 按“i”进入编辑模式，新增URL替换配置。

```
[url "https://gitlab.com/cznic/cc.git"]
insteadOf = https://gitlab.com/cznic/cc
[url "https://gitlab.com/cznic/golex.git"]
insteadOf = https://gitlab.com/cznic/golex
[url "https://gitlab.com/cznic/mathutil.git"]
insteadOf = https://gitlab.com/cznic/mathutil
[url "https://gitlab.com/cznic/strutil.git"]
insteadOf = https://gitlab.com/cznic/strutil
[url "https://gitlab.com/cznic/xc.git"]
insteadOf = https://gitlab.com/cznic/xc
```


  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
