报错提示如下:

 fatal: could not read Username for 'https://git.baidu.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.

解决办法

如果您在非交互式环境(例如脚本或自动化流程)中运行 Go 命令,则可能需要为 Git 启用终端提示。您可以在运行 Go 命令之前将 GIT_TERMINAL_PROMPT 环境变量设置为 1:

export GIT_TERMINAL_PROMPT=1
go get <import path>
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐