---
title: 准备Hoverfly编译环境
description: "1. 配置GO环境变量。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengwebs/ecosystemEnable/DependencyLibrary/kunpenghoverflyjunit_02_0008.html
sourcePath: /source/zh/kunpengwebs/ecosystemEnable/DependencyLibrary/kunpenghoverflyjunit_02_0008.html
indexId: ab63a0eaa2d52ce67a7042836f65ac5cf967ed84d8e5ece7182b5e1988e4cfcd90
---
# 准备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”保存并退出编辑。
