go mod tidy -v 死活安装不上依赖。出现GitHub的代码URL错误,拉取404。

经过一番研究,原来是CentOS6下 git的版本是1.7.1导致的。因为go get就是包装了git

通过编译安装git后,解决问题。

yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
yum remove git
wget -c https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz
tar xzf git-2.21.0.tar.gz
cd git-2.21.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

0 comments