0%

fatal: could not read Username for 'https://github.com': terminal prompts disabled

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  P1038 git:(master) go mod tidy                                                                    
go: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: reading https://goproxy.cn/github.com/xhs/canal/@v/v0.0.0-20220414041559-999a49d06083.mod: 404 Not Found
server response:
not found: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/58038aa5791c26db501ba0c05ac1e67495df9d5cb445d748f40ccd12746af405: exit status 128:
fatal: could not read Username for 'https://github.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: downloading github.com/xhs/canal v0.0.0-20220414041559-999a49d06083
go: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: reading https://goproxy.cn/github.com/xhs/canal/@v/v0.0.0-20220414041559-999a49d06083.mod: 404 Not Found
server response:
not found: github.com/xhs/canal@v0.0.0-20220414041559-999a49d06083: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/58038aa5791c26db501ba0c05ac1e67495df9d5cb445d748f40ccd12746af405: exit status 128:
fatal: could not read Username for 'https://github.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.

访问的地址感觉不对,带着代理的地址

1
https://goproxy.cn/github.com/xhs/canal/@v/v0.0.0-20220414041559-999a49d06083.mod

去掉了依然访问不到
修改 go 环境变量,把代理去掉
go env -w GOPROXY=""
问题解决