关于go get安装git golang项目时报错的处理办法

使用go get安装github上的项目时一般来说,不可避免会出错。各种错误的处理办法:

必须条件:

1、安装git并配置环境变量。下载地址:http://git-scm.com/

2、安装golang环境,并配置好环境变量。

其它错误:

1、提示 missing Mercurial command

需要下载安装Mercurial软件tortoisehg。地址:mercurial.selenic.com

下载不了?那得自备梯子。

2、提示exec: “git”: executable file not found in %PATH%

git没有安装正确。可能是环境变量没配置好。

3、SSL certificate problem

运行go get前先把认证关掉,在命令行执行:

git config –global http.sslVerify false

4、如果网络连接有问题,需要先准备个梯子,然后在go get命令执行前,先给git设置代理,然后再goget:

git config –global http.proxy “127.0.0.1:8087”

go get …

或者可以在go get的同时指定代理:

http_proxy=127.0.0.1:8087 go get …..