Go get命令出现terminal prompts disabled解决

错误长这样

ubuntu@ubuntu:~$ go get -u github.com/XXX/OOOO/
# cd .; git clone https://github.com/XXX/OOOO/ /home/ubuntu/.go/src/github.com/XXX/OOOO/
Cloning into '/home/ubuntu/.go/src/github.com/maoxs2/Proj_Ridal'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
package github.com/XXX/OOOO/: exit status 128

原因go get disable "terminal prompt" by default(Go get 命令默认禁用terminal prompt,即终端提示)

解决方案:环境设置GIT_TERMINAL_PROMPT=1

export GIT_TERMINAL_PROMPT=1
go get XXX

后记:其实最终问题还是我记错库名了……

你可能感兴趣的:(Go get命令出现terminal prompts disabled解决)