關於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 …..