本系列文章均为学习过程中记录的笔记,欢迎和我一起来学习Go语言。
全文使用环境如下:
- Go语言版本:1.14
- 操作系统:deepin
- 使用工具:Goland开发工具
我在日常编写项目时总是喜欢使用自己的公共工具组件,go语言1.11版本以后增加了mod功能,这就可以将自己的公共组件直接从仓库里面拉取下来了,但是拉取的过程注定是存在天坑的,以下就是我在使用该功能时汇总的一些常见错误和解决方案,希望能给大家带来一些帮助。
执行go get gitee.com/xxx/xxxxxx.git常见错误汇总
错误1
status 128:
fatal: unable to connect to gitee.com:
gitee.com[0: 212.64.62.174]: errno=No such file or directory
造成原因:
需要用https才能读到数据
解决方案:
执行如下命令
git config --global url."git@gitee.com:".insteadOf "https://gitee.com/"
或在git的~/.gitconfig文件中增加配置
[url "git@gitee.com:"]
insteadOf = https://gitee.com/