我是靠谱客的博主 谦让中心,最近开发中收集的这篇文章主要介绍go get 下载包时提示 could not read Username,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

问题

在下载公司内部的包时,出现如下提示:

go get: module example.com/somepkg/common: git ls-remote -q origin in /somepath/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: exit status 128:
        fatal: could not read Username for 'https://xxx.example.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

原因

查询了下必应,大致原因是,下载包时,没有用户名和密码,导致没有权限,因此需要启用弹窗,以便输入用户名和密码。

解决

设置环境变量:GIT_TERMINAL_PROMPT 为 1

也可以在你 go get example.com/some/pkg 时,直接设置:GIT_TERMINAL_PROMPT=1 go get -u example.com/path/yourpkg

参考

  • https://www.cnblogs.com/DarrenChan/p/10427932.html

最后

以上就是谦让中心为你收集整理的go get 下载包时提示 could not read Username的全部内容,希望文章能够帮你解决go get 下载包时提示 could not read Username所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部