windows下 代码在码云用vs code 执行go get报错terminal prompts disabled

获取码云上文件,go get 或go mod tidy报 terminal prompts disabled错误

go: gitee.com/xxx/[email protected]: invalid version: git fetch -f https://gitee.com/xxx/xxx/heads/*:refs/heads/* refs/tags/*:refs/tags/* in C:\Users\xxx\go\pkg\mod\cache\vcs\xxx: exit status 128:
        fatal: could not read Username for 'https://gitee.com': terminal prompts disabled

 

执行下述操作

1.vscode设置环境变量GOPROXY=https://goproxy.cn,direct

go env -w GOPROXY=https://goproxy.io,direct
# Set environment variable allow bypassing the proxy for selected modules
go env -w GOPRIVATE=*.corp.example.com
go env -w GO111MODULE=on
 

2.git config --global --add url."[email protected]:".insteadOf "https://gitee.com/"

2.go mod tidy 成功

 

你可能感兴趣的:(windows下 代码在码云用vs code 执行go get报错terminal prompts disabled)