【golang】go get拉取私有仓库gitlab错误总结

下载gitlab私有仓库时出现

fatal: could not read Username for 'http://gitlab.secwx.com': terminal prompts disabled

这是因为私有仓库需要输入密码,而go get,默认关闭终端输入,解决办法:

export GIT_TERMINAL_PROMPT=1

下载gitlab私有仓库出现

go: gitlab.xxxxx.com/xxxx/xxxx@v0.0.0-20200604101819-23130a9c3be4: reading https://goproxy.io/gitlab.secwx.com/clearvision/godictor/@v/v0.0.0-20200604101819-23130a9c3be4.mod: 404 Not Found
        server response: not found:

这是应为走代理不能访问到私有仓库,默认私有仓库跳过代理,解决办法:

go env -w GOPRIVATE=gitlab.*.com

如果还不行需要加上:

go get -insecure  xxxxxx

跳过https

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。